improve unit test and code coverage #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
- name: Extract test data | |
run: make extract_test_data | |
- name: Run tests | |
run: cargo test --verbose | |
env: | |
CARGO_INCREMENTAL: '0' | |
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | |
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | |
- name: rust-grcov | |
id: coverage | |
# You may pin to the exact commit or the version. | |
# uses: actions-rs/grcov@bb47b1ed7883a1502fa6875d562727ace2511248 | |
uses: actions-rs/grcov@v0.1 | |
- name: Codecov | |
# You may pin to the exact commit or the version. | |
# uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 | |
uses: codecov/codecov-action@v4.0.1 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
# Repository upload token - get it from codecov.io. Required only for private repositories | |
# token: # optional | |
# Specify whether the Codecov output should be verbose | |
verbose: true | |
fail_ci_if_error: true | |
file: ${{ steps.coverage.outputs.report }} |