forked from matthijsr/tydi
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.16 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
name: Coverage
on:
push:
branches:
- staging
- trying
pull_request:
paths:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
jobs:
rust:
name: Rust
runs-on: ubuntu-18.04
env:
RUSTFLAGS: -C link-dead-code
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- run: cargo test --no-run --all-features --all-targets --message-format=json | jq -r "select(.profile.test == true) | .executable" > test.files
- uses: docker://kcov/kcov:v38
with:
entrypoint: true
- name: Kcov
run: |
docker run --rm --security-opt seccomp=unconfined \
--workdir /home/runner/work/tydi/tydi \
-v "/var/run/docker.sock":"/var/run/docker.sock" \
-v "/home/runner/work/tydi/tydi":"/home/runner/work/tydi/tydi" \
--entrypoint "/bin/bash" \
kcov/kcov:v38 \
-c "mkdir -p target/cov/rust && cat test.files | xargs -l kcov --include-path=src/ --exclude-region='#[cfg(test)]' target/cov/rust"
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}