2024-01-03 10:24:52 +00:00
|
|
|
name: code-coverage
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "main"]
|
|
|
|
pull_request:
|
|
|
|
branches: [ "main" ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
unittest-cov:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-02-06 10:46:35 +00:00
|
|
|
- name: Free Disk Space (Ubuntu)
|
|
|
|
uses: jlumbroso/free-disk-space@main
|
|
|
|
with:
|
|
|
|
# this might remove tools that are actually needed,
|
|
|
|
# if set to "true" but frees about 6 GB
|
|
|
|
tool-cache: false
|
|
|
|
android: true
|
|
|
|
dotnet: true
|
|
|
|
haskell: true
|
|
|
|
large-packages: false
|
|
|
|
docker-images: true
|
|
|
|
swap-storage: true
|
|
|
|
|
2024-01-29 08:25:04 +00:00
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
2024-01-03 10:24:52 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
2024-01-29 08:25:04 +00:00
|
|
|
- name: Setup Rust (cache & toolchain)
|
|
|
|
uses: ./.github/actions/setup-rust
|
2024-01-03 10:24:52 +00:00
|
|
|
|
|
|
|
- name: Run unittest
|
2024-01-26 11:48:40 +00:00
|
|
|
run: cargo test --all-features --no-fail-fast
|
2024-01-03 10:24:52 +00:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: '0'
|
|
|
|
RUSTC_BOOTSTRAP: '1'
|
|
|
|
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
|
|
|
|
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
|
|
|
|
|
|
|
|
- id: coverage
|
|
|
|
uses: actions-rs/grcov@v0.1
|
|
|
|
|
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v3
|
|
|
|
with:
|
|
|
|
file: ${{ steps.coverage.outputs.report }}
|
2024-01-25 11:00:00 +00:00
|
|
|
# Disable to avoid CI failure as following:
|
|
|
|
# ['error'] There was an error running the uploader: Error uploading to https://codecov.io: Error: There was an error fetching the storage
|
|
|
|
# URL during POST: 404 - {'detail': ErrorDetail(string='Could not find a repository, try using repo upload token', code='not_found')}
|
|
|
|
# fail_ci_if_error: true
|