Skip to content

Commit cf9b8c0

Browse files
committed
Optimise validation action
1 parent a3728a0 commit cf9b8c0

1 file changed

Lines changed: 12 additions & 17 deletions

File tree

.github/workflows/validate.yaml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ permissions: read-all
1515
jobs:
1616

1717
validate:
18-
name: QC
18+
name: ${{ matrix.check }}
1919
runs-on: ubuntu-24.04
2020
timeout-minutes: 5
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
check: [yaml-lint, python-lint, python-format, shell-check]
2125

2226
env:
2327
UV_CACHE_DIR: /tmp/.uv-cache
@@ -31,31 +35,25 @@ jobs:
3135
with:
3236
python-version: ${{ env.UV_PYTHON }}
3337
enable-cache: true
34-
35-
- name: Restore uv cache
36-
uses: actions/cache@v4
37-
with:
38-
path: ${{ env.UV_CACHE_DIR }}
39-
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
40-
restore-keys: |
41-
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
42-
uv-${{ runner.os }}
38+
cache-dependency-glob: "uv.lock"
4339

4440
- name: Install dependencies
45-
run: uv sync
41+
run: uv sync --frozen
4642

4743
- name: YAML Lint
44+
if: matrix.check == 'yaml-lint'
4845
run: uv run yamllint -s .
4946

5047
- name: Python Lint
51-
if: always()
48+
if: matrix.check == 'python-lint'
5249
run: uv run ruff check --respect-gitignore .
50+
5351
- name: Python Format Check
54-
if: always()
52+
if: matrix.check == 'python-format'
5553
run: uv run ruff format --check --diff -s --respect-gitignore .
5654

5755
- name: Shell Check
58-
if: always()
56+
if: matrix.check == 'shell-check'
5957
shell: bash
6058
run: |
6159
mapfile -d '' potential_files < <(
@@ -71,6 +69,3 @@ jobs:
7169
| xargs -r uv run shellcheck -S warning \
7270
&& echo "All checks passed!"
7371
continue-on-error: true
74-
75-
- name: Minimize uv cache
76-
run: uv cache prune --ci

0 commit comments

Comments
 (0)