Skip to content

Commit

Permalink
Rust Code Coverage Reporting (filecoin-project#612)
Browse files Browse the repository at this point in the history
* first stab at CI

* dont use cuda for CI, enable debug feature for SDK

* merge coverage action with main ci test run

* add special case for matrix item

* rename uses to tool to avoid keyword conflict

* just download llvm-cov for every item in matrix for now

* if statement test

* fix ci if statements (hopefully)

* maybe fix if statement

* fix ci if statements for sure this time

* use sha hash for ci dep versions, dont import llvm-cov when uneeded

* split integration tests into its own job for seperate coverage tooling later, use version number for instead of sha for sub-tool

* add right tools to test job

* fix coverage report file output names

* rename jobs
  • Loading branch information
mriise authored Jun 10, 2022
1 parent 6cfc337 commit bff7b65
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,18 @@ jobs:
args: --all --all-targets
components: clippy
- name: test-fvm
command: test
args: --package fvm --no-default-features
covname: fvm-lcov.info
command: llvm-cov
args: --package fvm --no-default-features --lcov --output-path fvm-lcov.info
components: llvm-tools-preview
- name: test
covname: lcov.info
command: llvm-cov
args: --all --exclude fvm --exclude fvm_conformance_tests --exclude fvm_integration_tests --exclude "*actor" --lcov --output-path lcov.info
components: llvm-tools-preview
- name: integration
command: test
args: --all --exclude fvm --exclude fvm_conformance_tests
args: --package fvm_integration_tests --package "*actor"
- name: conformance
command: test
args: --package fvm_conformance_tests
Expand All @@ -52,8 +59,9 @@ jobs:
env:
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache
CARGO_INCREMENTAL: 0
CACHE_SKIP_SAVE: ${{ matrix.push == '' || matrix.push == 'false' }}
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
name: ${{ matrix.name }}
steps:
- name: Checking out fvm
Expand All @@ -72,6 +80,11 @@ jobs:
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: generate-lockfile
- name: Installing Cargo llvm-cov
if: ${{ matrix.covname }}
uses: taiki-e/install-action@bc0a06a003a8225fe3e896c9ed3a4c3cc2e8416a
with:
tool: [email protected]
- name: Setting up cache
uses: ./.github/actions/rust-sccache
env:
Expand All @@ -85,3 +98,9 @@ jobs:
with:
command: ${{ matrix.command }}
args: ${{ matrix.args }}
- name: Upload coverage to Codecov
if: ${{ matrix.covname }}
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378
with:
files: ${{ matrix.covname }}
fail_ci_if_error: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Cargo.lock
*.wasm
!testing/integration/tests/assets/*
.idea/
lcov.info

0 comments on commit bff7b65

Please sign in to comment.