Skip to content

Commit a6bb612

Browse files
committed
ci: fix workflow YAML indentation and add workflow-lint job
1 parent b52f6b0 commit a6bb612

File tree

1 file changed

+72
-64
lines changed

1 file changed

+72
-64
lines changed

.github/workflows/optimized-ci.yml

Lines changed: 72 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,17 @@ jobs:
120120
- name: Check workspace integrity
121121
run: cargo check --workspace --all-targets
122122

123+
# Workflow linting to catch YAML/schema problems early
124+
workflow-lint:
125+
name: Workflow Lint
126+
runs-on: ubuntu-latest
127+
needs: preflight
128+
steps:
129+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
130+
- name: Lint workflow YAML with yamllint (docker)
131+
run: |
132+
docker run --rm -v ${{ github.workspace }}:/workdir cytopia/yamllint yamllint -f parsable .github/workflows/optimized-ci.yml
133+
123134
# Parallel build with sccache
124135
build:
125136
name: Build
@@ -185,9 +196,9 @@ jobs:
185196
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
186197
with:
187198
path: target
188-
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
199+
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
189200

190-
- name: Run partitioned tests
201+
- name: Run partitioned tests
191202
run: |
192203
cargo nextest run --workspace --all-features \
193204
--partition count:${{ matrix.partition }}/4 \
@@ -208,18 +219,18 @@ jobs:
208219
- name: Install Rust
209220
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
210221

211-
- name: Install cargo-nextest
212-
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
213-
with:
214-
tool: cargo-nextest
222+
- name: Install cargo-nextest
223+
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
224+
with:
225+
tool: cargo-nextest
215226

216-
- name: Cache target
217-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
218-
with:
219-
path: target
220-
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
227+
- name: Cache target
228+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
229+
with:
230+
path: target
231+
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
221232

222-
- name: Test CLI crate
233+
- name: Test CLI crate
223234
run: cargo nextest run -p code_guardian_cli --all-features --verbose
224235

225236
test-core:
@@ -235,19 +246,18 @@ jobs:
235246

236247
- name: Install Rust
237248
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
249+
- name: Install cargo-nextest
250+
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
251+
with:
252+
tool: cargo-nextest
238253

239-
- name: Install cargo-nextest
240-
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
241-
with:
242-
tool: cargo-nextest
243-
244-
- name: Cache target
245-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
246-
with:
247-
path: target
248-
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
254+
- name: Cache target
255+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
256+
with:
257+
path: target
258+
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
249259

250-
- name: Test Core crate
260+
- name: Test Core crate
251261
run: cargo nextest run -p code_guardian_core --all-features --verbose
252262

253263
test-output:
@@ -263,19 +273,18 @@ jobs:
263273

264274
- name: Install Rust
265275
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
276+
- name: Install cargo-nextest
277+
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
278+
with:
279+
tool: cargo-nextest
266280

267-
- name: Install cargo-nextest
268-
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
269-
with:
270-
tool: cargo-nextest
271-
272-
- name: Cache target
273-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
274-
with:
275-
path: target
276-
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
281+
- name: Cache target
282+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
283+
with:
284+
path: target
285+
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
277286

278-
- name: Test Output crate
287+
- name: Test Output crate
279288
run: cargo nextest run -p code_guardian_output --all-features --verbose
280289

281290
test-storage:
@@ -291,19 +300,18 @@ jobs:
291300

292301
- name: Install Rust
293302
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
303+
- name: Install cargo-nextest
304+
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
305+
with:
306+
tool: cargo-nextest
294307

295-
- name: Install cargo-nextest
296-
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
297-
with:
298-
tool: cargo-nextest
299-
300-
- name: Cache target
301-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
302-
with:
303-
path: target
304-
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
308+
- name: Cache target
309+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
310+
with:
311+
path: target
312+
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
305313

306-
- name: Test Storage crate
314+
- name: Test Storage crate
307315
run: cargo nextest run -p code_guardian_storage --all-features --verbose
308316

309317
# Cross-platform testing
@@ -321,12 +329,12 @@ jobs:
321329
- name: Install Rust
322330
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
323331

324-
- name: Install cargo-nextest
325-
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
326-
with:
327-
tool: cargo-nextest
332+
- name: Install cargo-nextest
333+
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
334+
with:
335+
tool: cargo-nextest
328336

329-
- name: Cache cargo registry
337+
- name: Cache cargo registry
330338
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
331339
with:
332340
path: |
@@ -360,12 +368,12 @@ jobs:
360368
with:
361369
components: llvm-tools-preview
362370

363-
- name: Install cargo-llvm-cov
364-
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
365-
with:
366-
tool: cargo-llvm-cov
371+
- name: Install cargo-llvm-cov
372+
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
373+
with:
374+
tool: cargo-llvm-cov
367375

368-
- name: Cache target
376+
- name: Cache target
369377
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
370378
with:
371379
path: target
@@ -471,17 +479,17 @@ jobs:
471479
- name: Install Rust
472480
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
473481

474-
- name: Install cargo-audit
475-
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
476-
with:
477-
tool: cargo-audit
482+
- name: Install cargo-audit
483+
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
484+
with:
485+
tool: cargo-audit
478486

479-
- name: Install cargo-deny
480-
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
481-
with:
482-
tool: cargo-deny
487+
- name: Install cargo-deny
488+
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
489+
with:
490+
tool: cargo-deny
483491

484-
- name: Run security audit
492+
- name: Run security audit
485493
run: cargo audit --format json | tee audit-results.json
486494

487495
- name: Run cargo-deny

0 commit comments

Comments
 (0)