|
1 | | -name: test |
2 | | - |
3 | | -on: [push, pull_request] |
| 1 | +name: "Test Suite" |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + pull_request: |
4 | 7 |
|
5 | 8 | jobs: |
6 | 9 | test: |
7 | | - runs-on: ubuntu-22.04 |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + os: |
| 13 | + - ubuntu |
| 14 | + - macos |
| 15 | + - windows |
| 16 | + toolchain: |
| 17 | + - stable |
| 18 | + - 1.78 |
| 19 | + name: cargo test on ${{ matrix.os }}, rust ${{ matrix.toolchain }} |
| 20 | + runs-on: ${{ matrix.os }}-latest |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 24 | + with: |
| 25 | + toolchain: ${{ matrix.toolchain }} |
| 26 | + - name: Cargo test |
| 27 | + run: cargo test --workspace --all-targets |
| 28 | + |
| 29 | + # Check mdbook files for errors |
| 30 | + mdbook: |
| 31 | + name: test mdBook |
| 32 | + runs-on: ubuntu-latest |
8 | 33 | steps: |
9 | | - - uses: actions/checkout@v4 |
10 | | - - run: rustup update 1.65 --no-self-update && rustup default 1.65 |
11 | | - - run: cargo build |
12 | | - - name: test mdBook |
13 | | - # rustdoc doesn't build dependencies, so it needs to run after `cargo build`, |
14 | | - # but its dependency search gets confused if there are multiple copies of any |
15 | | - # dependency in target/debug/deps, so it needs to run before `cargo test` et al. |
16 | | - # clutter target/debug/deps with multiple copies of things. |
17 | | - run: for file in $(find mdbook -name '*.md'); do rustdoc --test $file -L ./target/debug/deps; done |
18 | | - - run: cargo test |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 36 | + # rustdoc doesn't build dependencies, so it needs to run after `cargo build`, |
| 37 | + # but its dependency search gets confused if there are multiple copies of any |
| 38 | + # dependency in target/debug/deps, so it needs to run before `cargo test` et al. |
| 39 | + # clutter target/debug/deps with multiple copies of things. |
| 40 | + - run: cargo clean |
| 41 | + - run: cargo build |
| 42 | + - name: test mdBook |
| 43 | + run: for file in $(find mdbook -name '*.md' | sort); do rustdoc --test $file -L ./target/debug/deps; done |
0 commit comments