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
name: Tests
on:
push:
pull_request:
jobs:
check:
name: fmt + clippy + test
runs-on: ubuntu-latest
steps:
# NOTE: the spec is a sibling checkout, not a vendored copy, and three
# test files skip without it: the schema and statement fidelity suite
# (tests/spec_drift.rs), the object-naming vectors the format makes a
# MUST (tests/objects.rs) and the Annex A conventions
# (tests/conventions.rs). Checking it out is what makes them run, and
# drift between the two repositories is exactly what nothing else
# notices.
- uses: actions/checkout@v4
with:
path: io-pimdir
- uses: actions/checkout@v4
with:
repository: pimalaya/pimdir
path: pimdir
# NOTE: io-replica is a path dependency until the release carrying the
# duplicate-link-id freeze is published (see Cargo.toml), so it has to
# sit beside this checkout too.
- uses: actions/checkout@v4
with:
repository: pimalaya/io-replica
path: io-replica
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- run: cargo fmt --all --check
working-directory: io-pimdir
- run: cargo clippy --all-targets --all-features -- -D warnings
working-directory: io-pimdir
- run: cargo test --all-features
working-directory: io-pimdir
# The three suites above skip silently when the spec is absent, so a
# green run proves nothing unless they actually ran.
- name: The spec suites ran rather than skipped
working-directory: io-pimdir
run: |
set -eu
for suite in spec_drift objects conventions; do
if cargo test --all-features --test "$suite" -- --nocapture 2>&1 | grep -q "skipped: no pimdir spec checkout"; then
echo "::error::$suite skipped: the pimdir checkout was not found"
exit 1
fi
done