Skip to content

Fix codecov #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
rust_toolchain: [nightly-2023-05-09]
rust_toolchain: [nightly-2023-05-22]
rust_target: [x86_64-unknown-linux-gnu, wasm32-wasi]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust_toolchain }}
target: ${{ matrix.rust_target }}
override: true

- uses: Swatinem/rust-cache@v2
Expand All @@ -44,8 +46,34 @@ jobs:
# default: ". -> target"
# workspaces: ""
- name: Build
run: cargo build --verbose
run: cargo build --verbose --target ${{ matrix.rust_target }}
- name: Install cargo-wasi
if: matrix.rust_target == 'wasm32-wasi'
run: cargo install cargo-wasi
- name: Install wasmtime
if: matrix.rust_target == 'wasm32-wasi'
run: |
curl https://wasmtime.dev/install.sh -sSf | bash
echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH
- name: Run tests
run: |
cargo test --verbose

if [ "${{ matrix.rust_target }}" == "wasm32-wasi" ]; then
cargo wasi test --verbose --target ${{ matrix.rust_target }}
else
cargo test --verbose --target ${{ matrix.rust_target }}
fi
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: ${{ matrix.rust_target == 'x86_64-unknown-linux-gnu' && '-Zprofile -Cinstrument-coverage -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' || '' }}
RUSTDOCFLAGS: ${{ matrix.rust_target == 'x86_64-unknown-linux-gnu' && '-Zprofile -Cinstrument-coverage -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' || '' }}
- name: rust-grcov
if: matrix.rust_target == 'x86_64-unknown-linux-gnu'
id: rs-cov
uses: actions-rs/[email protected]
# Needs to be public first
# - name: Codecov
# uses: codecov/[email protected]
# with:
# verbose: true
# fail_ci_if_error: true
# files: ${{ steps.rs-cov.outputs.report }}