-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (62 loc) · 1.88 KB
/
tests.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
66
67
68
69
70
name: Tests
on:
push:
pull_request:
branches:
- main
jobs:
tests:
name: Run Tests
env:
PROJECT_NAME_UNDERSCORE: murray-rs
CARGO_INCREMENTAL: 0
RUSTFLAGS: -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort
RUSTDOCFLAGS: -Cpanic=abort
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- nightly
steps:
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v2
# Setup Toolchain
- name: Setup Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
# Build
- name: Build
run: cargo build $CARGO_OPTIONS
# Cache
- name: Configure cache
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: test-${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
# Coverage
##! CARGO_INCREMENTAL, RUSTFLAGS, RUSTDOCFLAGS - added to CARGO_OPTIONS in cargo test needed for code coverage
- name: Generate test result and coverage report
run: |
find . -name '*.gcda' -delete
cargo install grcov --force;
rm -rf lcov.info;
sudo apt install make -y
make run-all-tests $CARGO_OPTIONS;
zip -0 ccov.zip `find . \( -name "$PROJECT_NAME_UNDERSCORE*.gc*" \) -print`;
grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" -o lcov.info;
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Guilospanck/murray-rs
files: ./lcov.info
fail_ci_if_error: true