Skip to content

Commit abf0ef4

Browse files
ci: use matrix for code validation
1 parent bb71c4c commit abf0ef4

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

.github/workflows/pipeline.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ concurrency:
2020

2121
jobs:
2222
code_validation:
23-
name: Code Validation
23+
name: 'Code Validation: ${{ matrix.validation_script }}'
2424
runs-on: ubuntu-latest
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
validation_script:
29+
['lint', 'type-check', 'format:check', 'generate-all:check']
2530

2631
steps:
2732
- name: Checkout
@@ -37,17 +42,8 @@ jobs:
3742
with:
3843
useLockFile: false
3944

40-
- name: Check Types
41-
run: npm run type-check
42-
43-
- name: Lint code
44-
run: npm run lint
45-
46-
- name: Check format
47-
run: npm run format:check
48-
49-
- name: Check autogenerated docs
50-
run: npm run generate-all && git diff --exit-code
45+
- name: Run script
46+
run: npm run ${{ matrix.validation_script }}
5147

5248
tests:
5349
name: Tests (Node v${{ matrix.node }} - ESLint v${{ matrix.eslint }})

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"build": "tsc",
3131
"postbuild": "cpy README.md ./dist && cpy package.json ./dist && cpy LICENSE ./dist",
3232
"generate-all": "run-p \"generate:*\"",
33+
"generate-all:check": "npm run generate-all && git diff --exit-code",
3334
"generate:configs": "ts-node tools/generate-configs",
3435
"generate:rules-doc": "npm run build && npm run rule-doc-generator",
3536
"format": "npm run prettier-base -- --write",

0 commit comments

Comments
 (0)