-
Notifications
You must be signed in to change notification settings - Fork 18
93 lines (72 loc) · 4.01 KB
/
code_coverage.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Code Coverage
# Controls when the action will run. Triggers the workflow on push or pull request
on: [push]
env:
nap_time: 120
jobs:
Collect-code-coverage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Set up environment
uses: ./.github/workflows/composite_action/sim
with:
container-name: 'code_coverage'
build-envs: 'OCCLUM_COV=1'
container-flags: '--privileged -e OCCLUM_LOG_LEVEL=trace'
- name: Integration test
run: docker exec code_coverage bash -c "cd /root/occlum; SGX_MODE=SIM make test"
- name: Integration test with Glibc
run: docker exec code_coverage bash -c "cd /root/occlum; SGX_MODE=SIM make test-glibc"
- name: C test
run: docker exec code_coverage bash -c "cd /root/occlum/demos/hello_c && make;
occlum new occlum_instance;
cd occlum_instance && rm -rf image;
copy_bom -f ../hello.yaml --root image --include-dir /opt/occlum/etc/template;
SGX_MODE=SIM occlum build;
occlum run /bin/hello_world"
- name: C++ test
run: docker exec code_coverage bash -c "cd /root/occlum/demos/hello_cc && make;
occlum new occlum_instance;
cd occlum_instance && rm -rf image;
copy_bom -f ../hello.yaml --root image --include-dir /opt/occlum/etc/template;
SGX_MODE=SIM occlum build;
occlum run /bin/hello_world"
- name: Rust test
run: docker exec code_coverage bash -c "cd /root/occlum/demos/rust && SGX_MODE=SIM ./run_rust_demo_on_occlum.sh"
- name: Run Golang sqlite test
run: docker exec code_coverage bash -c "cd /root/occlum/demos/golang/go_sqlite/ && SGX_MODE=SIM ./run_go_sqlite_demo.sh"
- name: Build Fish dependencies
run: docker exec code_coverage bash -c "cd /root/occlum/demos/fish && ./download_and_build.sh"
- name: Run Fish test
run: docker exec code_coverage bash -c "cd /root/occlum/demos/fish && SGX_MODE=SIM ./run_fish_test.sh"
- name: Run Fish process rlimit test
run: docker exec code_coverage bash -c "cd /root/occlum/demos/fish && SGX_MODE=SIM ./run_per_process_config_test.sh"
- name: Build LA dependencies
run: docker exec code_coverage bash -c "cd /root/occlum/demos/local_attestation && ./download_src_and_build_deps.sh"
- name: Run LA test
run: docker exec code_coverage bash -c "cd /root/occlum/demos/local_attestation && SGX_MODE=SIM make;
SGX_MODE=SIM make test"
- name: Build sqlite dependencies
run: docker exec code_coverage bash -c "cd /root/occlum/demos/sqlite && ./download_and_build_sqlite.sh"
- name: Run sqlite test
run: docker exec code_coverage bash -c "cd /root/occlum/demos/sqlite && SGX_MODE=SIM ./run_sqlite_on_occlum.sh"
- name: LTP test
run: docker exec code_coverage bash -c "cd /root/occlum/demos/linux-ltp && ./dl_and_build_ltp.sh && SGX_MODE=SIM ./prepare_ltp.sh;
cd ltp_instance;
occlum run /opt/ltp/run-ltp.sh -f syscalls-occlum"
- name : Gvisor syscall test
run: docker exec code_coverage bash -c "apt update && apt install curl gnupg -y;
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg;
mv bazel.gpg /etc/apt/trusted.gpg.d/;
echo 'deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8' | tee /etc/apt/sources.list.d/bazel.list;
apt update && apt install bazel -y;
git clone -b occlum-release-20200921.0 https://github.com/occlum/gvisor.git;
cd gvisor/occlum && ./build_and_install_syscall_tests.sh && SGX_MODE=SIM ./run_occlum_passed_tests.sh ngo"
- name: Upload coverage report
run: docker exec code_coverage bash -c "cd /root/occlum/build/internal/src/libos/cargo-target/debug/deps; export CODECOV_TOKEN="${{ secrets.COV_TOKEN }}"; bash <(curl -s https://codecov.io/bash)"
- name: Clean the environment
if: ${{ always() }}
run: docker stop code_coverage