-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-add codecov to get coverage reports
- Loading branch information
Showing
1 changed file
with
44 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,50 @@ | ||
on: | ||
push: | ||
branches: | ||
- '!trying' | ||
- '!trying.tmp' | ||
- '!staging' | ||
- '!staging.tmp' | ||
|
||
name: Coverage | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
RUSTFLAGS: "-Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off" | ||
|
||
jobs: | ||
coverage: | ||
name: Coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: 1.63 | ||
- name: Install LLVM (Linux) | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz | ||
mkdir -p /opt/llvm-10 | ||
tar xf llvm.tar.xz --strip-components=1 -C /opt/llvm-10 | ||
echo '/opt/llvm-10/bin' >> $GITHUB_PATH | ||
echo 'LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV | ||
- name: Generate Coverage Report | ||
run: | | ||
cargo install cargo-tarpaulin | ||
cargo tarpaulin --forward --release -t120 --out Xml --ignore-tests --workspace --exclude wasmer-wasi-experimental-io-devices --exclude wasmer-c-api -- --skip traps:: --skip spec::linking --test-threads=1 | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./cobertura.xml | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'staging' | ||
- 'trying' | ||
paths: | ||
- 'lib/**' | ||
tags: | ||
# this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet | ||
- '[0-9]+.[0-9]+.[0-9]+*' | ||
pull_request: | ||
paths: | ||
- 'lib/**' | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
env: | ||
CARGO_TERM_COLOR: always | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Rust | ||
run: rustup update stable | ||
- name: Install LLVM (Linux) | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz | ||
mkdir -p /opt/llvm-10 | ||
tar xf llvm.tar.xz --strip-components=1 -C /opt/llvm-10 | ||
echo '/opt/llvm-10/bin' >> $GITHUB_PATH | ||
echo 'LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Generate code coverage | ||
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | ||
env: | ||
WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: lcov.info | ||
fail_ci_if_error: true | ||
|