forked from viperproject/prusti-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (52 loc) · 1.82 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
57
58
59
60
61
62
63
64
65
name: Test coverage
on:
push:
branches: 'master'
paths-ignore: 'docs/**'
env:
RUST_BACKTRACE: 1
PRUSTI_ASSERT_TIMEOUT: 60000
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: '15'
- name: Set up the environment
run: python x.py setup
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: "shared"
- name: Enable collection of source-based coverage
run: |
# The following are necessary for profiling (see https://github.com/mozilla/grcov)
echo "RUSTFLAGS=-Cinstrument-coverage" >> $GITHUB_ENV
echo "LLVM_PROFILE_FILE="${GITHUB_WORKSPACE}/target/coverage/gcov-%p-%m.profraw"" >> $GITHUB_ENV
- name: Build with cargo
run: python x.py build --all
- name: Run cargo tests
run: python x.py test --all
- name: Rerun quick cargo tests, enabling debug dumps to cover more code
run: python x.py test quick
env:
PRUSTI_DUMP_DEBUG_INFO: true
PRUSTI_DUMP_VIPER_PROGRAM: true
PRUSTI_IGNORE_REGIONS: true
- name: Check prusti-contracts
run: |
cd prusti-contracts/prusti-contracts-test/
cargo build
- name: Collect coverage
run: |
curl -sL https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
./grcov . --llvm --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./lcov.info