Add portable feature #43
This file contains hidden or 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
name: test-suite | |
on: | |
push: | |
branches: | |
- main | |
- 'pr/*' | |
pull_request: | |
env: | |
# Deny warnings in CI | |
RUSTFLAGS: "-D warnings" | |
jobs: | |
cargo-fmt: | |
name: cargo-fmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get latest version of stable Rust | |
run: rustup update stable | |
- name: Check formatting with cargo fmt | |
run: cargo fmt --all -- --check | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
features: ["", "ring", "zero_hash_cache", "ring,zero_hash_cache"] | |
# Skip the ring-less builds on macOS ARM where ring is mandatory. | |
exclude: | |
- os: macos-latest | |
features: "" | |
- os: macos-latest | |
features: "zero_hash_cache" | |
runs-on: ${{ matrix.os }} | |
name: test-${{ matrix.os }}-feat-${{ matrix.features }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get latest version of stable Rust | |
run: rustup update stable | |
- name: Run tests | |
run: cargo test --release --no-default-features --features "${{ matrix.features }}" | |
# We use `--skip-clean` to aggregate the coverage from runs with different features. | |
coverage: | |
runs-on: ubuntu-latest | |
name: cargo-tarpaulin | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get latest version of stable Rust | |
run: rustup update stable | |
- name: Install cargo-tarpaulin | |
uses: taiki-e/install-action@cargo-tarpaulin | |
- name: Check code coverage with cargo-tarpaulin (no features) | |
run: cargo-tarpaulin --workspace --out xml --no-default-features | |
- name: Check code coverage with cargo-tarpaulin (just `ring` feature) | |
run: cargo-tarpaulin --workspace --out xml --skip-clean --no-default-features --features "ring" | |
- name: Check code coverage with cargo-tarpaulin (just `zero_hash_cache` feature) | |
run: cargo-tarpaulin --workspace --out xml --skip-clean --no-default-features --features "zero_hash_cache" | |
- name: Check code coverage with cargo-tarpaulin (all features) | |
run: cargo-tarpaulin --workspace --out xml --skip-clean --all-features | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
informational: true |