name: behavior
on:
push:
branches: [main]
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: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
- 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 with:
name: behavior-results
path: state/test-artifacts/behavior/
retention-days: 14
if-no-files-found: ignore