0g-storage-node/.github/workflows/cc.yml
Bo QIU e7011b4657
use common actoin to setup rust with cargo cache enabled (#14)
* use common actoin to setup rust with cargo cache enabled

* hotfix for actions syntax

* hotfix actions syntax

* fix wrong action path

* aaa

* bbb

* ccc

* ddd
2024-01-29 16:25:04 +08:00

44 lines
1.4 KiB
YAML

name: code-coverage
on:
push:
branches: [ "main"]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
unittest-cov:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Rust (cache & toolchain)
uses: ./.github/actions/setup-rust
- name: Run unittest
run: cargo test --all-features --no-fail-fast
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 }}
# 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