-
Notifications
You must be signed in to change notification settings - Fork 55
56 lines (49 loc) · 1.57 KB
/
coverage.yml
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
name: Code Coverage
on:
workflow_run:
workflows: ["Cargo Check"]
types:
- completed
jobs:
coverage:
runs-on:
labels: movement-runner
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
token: ${{ secrets.CI_PAT }}
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.70.0
components: rustfmt
- name: Install kcov
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
tar xzf master.tar.gz
mkdir kcov-master/build
cd kcov-master/build
cmake ..
make
sudo make install
- name: Build for Coverage
run: |
cd ./m1
cargo build -p subnet -p movement
- name: Test & Generate Coverage Report
run: |
for file in m1/target/debug/deps/*; do
mkdir -p "target/cov/$(basename $file)";
kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file";
done
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # Add your Codecov token here
directory: ./target/cov/