-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 2.13 KB
/
ci.yml
File metadata and controls
87 lines (75 loc) · 2.13 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
name: CI
on:
push:
branches: [ main ]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [ "18", "20", "22", "24" ]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Build
run: npm run build
- name: Test
run: npm test
lint:
name: Static analysis (ESLint)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- run: npm ci
- name: ESLint
run: npm run lint
coverage:
name: Coverage gate (>=90%)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- run: npm ci
- name: Coverage
run: npm run coverage
conformance:
name: Conformance suite in sync
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Verify vendored conformance matches the canonical suite
run: |
git clone --depth 1 https://github.com/BabelQueue/conformance.git "$RUNNER_TEMP/conformance"
diff -ru "$RUNNER_TEMP/conformance/manifest.json" "test/conformance/manifest.json"
diff -ru "$RUNNER_TEMP/conformance/fixtures" "test/conformance/fixtures"
diff -ru "$RUNNER_TEMP/conformance/schema" "test/conformance/schema"
echo "Vendored conformance is in sync with the canonical suite."
ci-green:
name: CI green
runs-on: ubuntu-latest
needs: [test, lint, coverage, conformance]
if: ${{ always() }}
steps:
- name: Fail if any required job did not pass
run: |
if ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}; then
echo "A required job failed or was cancelled."
exit 1
fi