-
-
Notifications
You must be signed in to change notification settings - Fork 31
104 lines (87 loc) · 3.54 KB
/
Copy pathci.yml
File metadata and controls
104 lines (87 loc) · 3.54 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
ci:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
with:
toolchain: stable
components: clippy, rustfmt
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
# Keep one stable dependency cache namespace across the OS matrix.
shared-key: agnix-workspace
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Format check
if: matrix.os == 'ubuntu-latest'
run: cargo fmt --check --all
- name: Clippy
if: matrix.os == 'ubuntu-latest'
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Test
run: cargo test --workspace
- name: Rule efficacy eval
if: matrix.os == 'ubuntu-latest'
# Exits non-zero if any tests/eval.yaml case's fired rules diverge from
# its expected set. Keeps the eval fixtures from silently drifting as
# rules are added or rescoped (see #981).
run: cargo run -p agnix-cli --bin agnix -- eval tests/eval.yaml
- name: Kiro S-tier Gate
if: matrix.os == 'ubuntu-latest'
run: cargo test -p agnix-cli --test kiro_ci_gate -- --include-ignored
- name: Rule bookkeeping sync check
if: matrix.os == 'ubuntu-latest'
# Fails if total_rules, count phrases, or the agnix-rules mirror
# drifted from knowledge-base/rules.json. Fix by running
# `node scripts/sync-rule-bookkeeping.js` locally.
run: node scripts/sync-rule-bookkeeping.js --check --skip-docs
- name: Rule count table check
if: matrix.os == 'ubuntu-latest'
# Fails if human-maintained rule count tables or current docs drift
# from knowledge-base/rules.json.
run: python3 scripts/check-rule-counts.py
- name: Locale sync check
if: matrix.os == 'ubuntu-latest'
# The i18n!() macro loads from each crate's own locales/ directory, so a
# diagnostic string edited only in the root copy silently never reaches
# the binary. Nothing gated this: the script existed but no workflow ran
# it.
run: bash scripts/check-locale-sync.sh
- name: Schema sync check
if: matrix.os == 'ubuntu-latest'
# Fails if the committed .agnix.toml schema differs from the current
# binary output, or if the VS Code extension copy drifted.
run: |
cargo run -p agnix-cli --bin agnix -- schema --fix --output schemas/agnix.json
cmp schemas/agnix.json editors/vscode/schemas/agnix.json
git diff --exit-code -- schemas/agnix.json editors/vscode/schemas/agnix.json
agnix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
with:
toolchain: stable
- name: Validate agent configurations
uses: ./
with:
config: '.agnix.toml'
fail-on-error: 'true'
build-from-source: 'true'