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
67
68
69
70
# FJ-2607: Behavior-driven infrastructure specs
# Runs forjar behavior tests against spec YAML files
name: behavior
on:
push:
branches:
paths:
- "src/**"
- "tests/**/*.spec.yaml"
- ".cargo/config.toml"
- ".github/workflows/behavior.yml"
pull_request:
paths:
- "src/**"
- "tests/**/*.spec.yaml"
workflow_dispatch:
concurrency:
group: behavior-${{ github.ref }}
cancel-in-progress: true
jobs:
behavior:
runs-on:
# infra#430: sixteen clean-room runners share one ~/.cargo, and an hourly
# reaper deletes registry/src entries by mtime -- under a live build, which
# makes rustc read a source file that has just vanished:
# couldn't read .../registry/src/.../<crate>/src/<file>.rs: No such file
# error: could not parse/generate dep info at: .../deps/<crate>.d
# MEASURED on this branch: msrv and coverage both died that way the first
# time PMAT-547 moved them off GitHub-hosted runners, where each job had a
# private ~/.cargo by construction. A registry private to this runner takes
# the job off the shared surface. The path is outside the workspace, so it
# survives the checkout clean and is a cache rather than a cold download.
# The host-side fix is paiml/infra's.
env:
CARGO_HOME: ${{ github.workspace }}/../cargo-home-${{ github.job }}
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build forjar
run: cargo build --release
- name: Run behavior specs
run: |
shopt -s nullglob
specs=(tests/**/*.spec.yaml)
if [ ${#specs[@]} -eq 0 ]; then
echo "No spec files found — skipping behavior tests"
exit 0
fi
for spec in "${specs[@]}"; do
echo "--- Running: $spec"
./target/release/forjar test --file "$spec" || exit 1
done
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: behavior-results
path: state/test-artifacts/behavior/
retention-days: 14
if-no-files-found: ignore