Make loom optional #145
Workflow file for this run
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
--- | |
name: Cargo build and test | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/*.yml | |
- '**/*.rs' | |
- Cargo.toml | |
- Cargo.lock | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: "--deny warnings " | |
jobs: | |
build-and-test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
rust: [stable, beta] | |
include: | |
- os: ubuntu-latest | |
rust: nightly | |
- os: ubuntu-latest | |
rust: 1.65.0 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: ${{ matrix.rust }} | |
default: true | |
- name: Install cargo-hack | |
uses: taiki-e/install-action@cargo-hack | |
- name: Build | |
run: cargo build | |
# Run `cargo test` with all combinations of features. Including loom correctness testing | |
- name: Test | |
run: cargo hack --feature-powerset --exclude-all-features --optional-deps loom test | |
# Run `cargo test` but with artificial delay injected into some code paths. This helps | |
# running through some hard-to-time code paths. loom testing is not included since it is not | |
# compatible nor make any sense together with sleeping. | |
- name: Test with artificial delay | |
shell: bash | |
run: RUSTFLAGS+="--cfg oneshot_test_delay" cargo hack --feature-powerset --exclude-all-features test |