-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (58 loc) · 2.06 KB
/
build-and-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
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
shell: bash
run: cargo build --locked
# Run through all tests with all combinations of features
- name: Test
shell: bash
run: cargo hack --feature-powerset --exclude-all-features 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
# Compile the library against loom to do correctness testing.
# `--features loom` must be given so that only feature powerset combinations including loom are tested.
- name: Test with loom
shell: bash
run: |
RUSTFLAGS+="--cfg oneshot_loom" LOOM_MAX_BRANCHES=100000 \
cargo hack --feature-powerset --exclude-all-features --features loom test
# Check that the documentation builds and has no warnings
- name: Build documentation
shell: bash
run: RUSTDOCFLAGS="--deny warnings" cargo hack --feature-powerset --exclude-all-features doc