1name: Coverage 2 3on: 4 push: 5 branches: 6 - master 7 pull_request: 8 9env: 10 CARGO_TERM_COLOR: always 11 RUST_BACKTRACE: full 12 13jobs: 14 coverage: 15 name: Coverage 16 runs-on: ubuntu-latest 17 steps: 18 - name: Checkout repository 19 uses: actions/checkout@v2 20 21 - name: Install Rust 22 uses: actions-rs/toolchain@v1 23 with: 24 toolchain: nightly 25 profile: minimal 26 default: true 27 28 - name: Pre-installing grcov 29 uses: actions-rs/install@v0.1 30 with: 31 crate: grcov 32 use-tool-cache: true 33 34 - name: Restore cache 35 uses: Swatinem/rust-cache@v1 36 37 - name: Run tests 38 run: cargo test --all --all-features 39 env: 40 CARGO_INCREMENTAL: '0' 41 RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' 42 RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' 43 # This seems not to work, the C code can't seem to find the gcov functions. By not providing this, we probably give up coverage from these :-( 44 #CFLAGS: --coverage 45 #CXXFLAGS: --coverage 46 47 - name: Generate coverage 48 uses: actions-rs/grcov@v0.1 49 50 - name: Upload to codecov.io 51 uses: codecov/codecov-action@5a8bb4701eca7ba3673f21664b887f652c58d0a3 52 with: 53 token: ${{ secrets.CODECOV_TOKEN }} 54