-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (47 loc) · 1.56 KB
/
test.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
name: test
on:
- push
jobs:
# Task test
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
# Checkout repo
- name: Checkout repo
uses: actions/checkout@v3
# Install toolchain
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
# build coverage
- name: Run unit tests
run: cargo test --features full
# Task coverage
coverage:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
# Checkout repo
- name: Checkout repo
uses: actions/checkout@v3
# Install toolchain
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
# Install grcov
- name: Install grcov
run: curl -L https://github.com/mozilla/grcov/releases/download/v0.8.2/grcov-linux-x86_64.tar.bz2 | tar jxf -
# Run coverage
- name: Build coverage
run: |
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
export RUSTDOCFLAGS="-Cpanic=abort"
cargo build --features full --verbose $CARGO_OPTIONS
cargo test --features full --verbose $CARGO_OPTIONS
zip -0 ccov.zip `find . \( -name "visdom*.gc*" \) -print`;
./grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" -o lcov.info;
bash <(curl -s https://codecov.io/bash) -f lcov.info;