Commit cc5a372
feat(governance): add rust-ci-reusable + elixir-ci-reusable workflows (#174)
## Why — extends #168 to the next two template-drift bug classes
\`#168\` (merged) consolidated language-policy into governance-reusable
and added deno-ci-reusable. That pattern — single source-of-truth
reusable in standards consumed via a thin wrapper — kills the "every
copy drifts independently" failure mode.
Estate audit done with \`gh api search/code\` (2026-05-26):
| template | repos | unique SHAs | drift |
|---------------------|-------|-------------|--------|
| \`rust-ci.yml\` | **137** | **30** | high |
| \`elixir-ci.yml\` | **9** | **9** | 100% |
| \`rescript-deno-ci.yml\` | 1+ | 2+ | fixed in #168 |
\`elixir-ci.yml\` is especially bad — every copy is unique, and at least
one (\`bofig\`) is YAML-broken with literal \`npermissions:\` lines from
a botched estate sweep.
## What changes
Two new reusable workflows in \`.github/workflows/\`:
### \`rust-ci-reusable.yml\`
- Split jobs: \`check\` (cargo check + fmt + clippy) and \`test\` (cargo
test). \`test\` \`needs: check\`.
- \`if: hashFiles('Cargo.toml')\` guard on every job so the wrapper is
safe to add to non-Rust repos.
- Top-level + per-job \`permissions: contents: read\`.
- Opt-in inputs:
- \`enable_audit\` (default false — \`cargo install cargo-audit\` adds
~3-4 min per run)
- \`enable_coverage\` (default false — tarpaulin + codecov upload)
- \`clippy_args\` / \`test_args\` / \`check_args\` — per-repo overrides
- \`runs-on\`
### \`elixir-ci-reusable.yml\`
- Two-cache layers (\`deps\` + \`_build\`), keyed by \`elixir-version\`
+ \`mix.lock\` hash.
- **\`mix deps.compile\`** step BEFORE \`mix compile
--warnings-as-errors\` so transitive-dep warnings (e.g. rustler's
\`:json.decode\` requiring Elixir 1.18, deprecated \`use Bitwise\`)
don't fail the strict gate. Validated against tma-mark2 #41 in commit
\`fa32c4f\`.
- Default \`elixir-version: \"1.17\"\` — the \`1.15\` default in the
legacy template produced the \`(Mix) … declared in its mix.exs file it
supports only Elixir ~> 1.17\` error tma-mark2 #41 lived.
- Opt-in inputs:
- \`enable_dialyzer\` (default false — slow cold-cache)
- \`enable_credo\` (default true)
- \`otp-version\` / \`elixir-version\` overrides
- Guards every job on \`hashFiles('mix.exs')\`.
## Downstream rollout
After merge, each of the 137 (Rust) / 9 (Elixir) repos can replace its
local copy with a 5-line wrapper:
\`\`\`yaml
# .github/workflows/rust-ci.yml
name: Rust CI
on:
push: { branches: [main, master] }
pull_request:
permissions:
contents: read
jobs:
rust-ci:
uses:
hyperpolymath/standards/.github/workflows/rust-ci-reusable.yml@main
\`\`\`
Same shape as \`governance.yml\` → \`governance-reusable.yml\`, and the
absolute-zero #41 + tma-mark2 #41 \`deno-ci.yml\` wrappers landed
yesterday. Rollout can be fanned out per-repo.
## Test plan
- [ ] CI green on this PR (the reusables are workflow_call-only; their
content gets exercised via the next PR that adopts them).
- [ ] After merge, file 1-2 wrapper PRs against repos with known-red
rust-ci CI as smoke tests (e.g., repos in the inbox triage that fail on
\`Workflow security linter\` complaining about missing
\`permissions:\`).
- [ ] Confirm \`enable_audit: true\` works on a repo that opts in.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 74ce78a commit cc5a372
2 files changed
Lines changed: 77 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
46 | 55 | | |
47 | 56 | | |
48 | 57 | | |
| |||
74 | 83 | | |
75 | 84 | | |
76 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
77 | 96 | | |
78 | 97 | | |
79 | 98 | | |
| |||
83 | 102 | | |
84 | 103 | | |
85 | 104 | | |
86 | | - | |
| 105 | + | |
87 | 106 | | |
88 | 107 | | |
89 | 108 | | |
90 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
91 | 113 | | |
92 | 114 | | |
93 | 115 | | |
| |||
104 | 126 | | |
105 | 127 | | |
106 | 128 | | |
107 | | - | |
108 | | - | |
| 129 | + | |
| 130 | + | |
109 | 131 | | |
110 | 132 | | |
111 | 133 | | |
112 | 134 | | |
113 | | - | |
114 | | - | |
| 135 | + | |
| 136 | + | |
115 | 137 | | |
116 | 138 | | |
117 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
32 | 51 | | |
33 | 52 | | |
34 | 53 | | |
| |||
65 | 84 | | |
66 | 85 | | |
67 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
68 | 98 | | |
69 | 99 | | |
70 | 100 | | |
| |||
76 | 106 | | |
77 | 107 | | |
78 | 108 | | |
79 | | - | |
| 109 | + | |
80 | 110 | | |
81 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
82 | 115 | | |
83 | 116 | | |
84 | 117 | | |
| |||
93 | 126 | | |
94 | 127 | | |
95 | 128 | | |
| 129 | + | |
| 130 | + | |
96 | 131 | | |
97 | 132 | | |
98 | 133 | | |
| |||
107 | 142 | | |
108 | 143 | | |
109 | 144 | | |
110 | | - | |
| 145 | + | |
111 | 146 | | |
112 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
113 | 151 | | |
114 | 152 | | |
115 | 153 | | |
| |||
122 | 160 | | |
123 | 161 | | |
124 | 162 | | |
| 163 | + | |
| 164 | + | |
125 | 165 | | |
126 | 166 | | |
127 | 167 | | |
| |||
139 | 179 | | |
140 | 180 | | |
141 | 181 | | |
142 | | - | |
| 182 | + | |
143 | 183 | | |
144 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
145 | 188 | | |
146 | 189 | | |
147 | 190 | | |
| |||
164 | 207 | | |
165 | 208 | | |
166 | 209 | | |
167 | | - | |
| 210 | + | |
168 | 211 | | |
169 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
170 | 216 | | |
171 | 217 | | |
172 | 218 | | |
| |||
0 commit comments