add code coverage to pipeline #7
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
on: | |
# push: | |
# branches: [main, 'release-v**'] | |
pull_request: | |
name: Code coverage | |
concurrency: | |
group: 'codecov-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
codecov: | |
runs-on: ubuntu-latest-8-cores | |
# container: | |
# image: xd009642/tarpaulin:develop-nightly | |
# options: --security-opt seccomp=unconfined | |
steps: | |
- uses: actions/checkout@master | |
- name: Prep build | |
uses: ./.github/actions/prep-ubuntu | |
with: | |
cache: enabled | |
# Cache needs Google credentials: | |
GWIP: ${{ secrets.GWIP_SCCACHE }} | |
GSA: ${{ secrets.GSA_SCCACHE }} | |
- name: Runing cargo release | |
run: ./ci/run-check.sh | |
env: | |
TARGET: cargo-build | |
RUSTC_WRAPPER: "sccache" | |
- name: Install Tarpaulin | |
run: cargo install --locked cargo-tarpaulin | |
- name: generate codecov reports | |
env: | |
RUST_BACKTRACE: 1 | |
RUSTC_WRAPPER: sccache | |
run: | | |
cargo tarpaulin --verbose --no-fail-fast --workspace --timeout 300 --exclude-files runtime/*/src/weights/** --out xml --out html | |
ls -la | |
# UPLOAD REPORTS (requires cargo 1.70.0) | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# files: ./coverage1.xml,./coverage2.xml # optional | |
# flags: unittests # optional | |
# name: codecov-umbrella # optional | |
# fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) |