Skip to content

Commit 79c282e

Browse files
committed
ci: move test matrix and end-to-end to PR workflow
All tests belong in the PR gate where they can block merges. The main workflow now only runs fuzz tests, which are too slow for PRs but useful as a post-merge smoke test.
1 parent 14e8319 commit 79c282e

2 files changed

Lines changed: 52 additions & 90 deletions

File tree

Lines changed: 2 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,12 @@
1-
name: "🔍 Tests Main"
1+
name: "🔍 Fuzz Tests"
22
on:
33
push:
44
branches: [main]
5-
merge_group:
65
workflow_dispatch:
76
concurrency:
8-
group:
9-
${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7+
group: ${{ github.workflow }}-${{ github.ref }}
108
cancel-in-progress: true
119
jobs:
12-
tests:
13-
name: tests
14-
runs-on: ${{ matrix.os }}
15-
strategy:
16-
matrix:
17-
os: [windows-latest, ubuntu-latest, macos-latest]
18-
node: [20]
19-
include:
20-
# Floor: legacy compatibility check
21-
- os: ubuntu-latest
22-
node: 14
23-
# Ceiling: current LTS
24-
- os: ubuntu-latest
25-
node: 24
26-
steps:
27-
- name: checkout
28-
uses: actions/checkout@v3
29-
- uses: actions/cache@v3
30-
id: cache-fuzzer
31-
with:
32-
path: |
33-
packages/fuzzer/prebuilds
34-
key:
35-
fuzzer-cache-${{ matrix.os }}-${{
36-
hashFiles('packages/fuzzer/CMakeLists.txt',
37-
'packages/fuzzer/**/*.h', 'packages/fuzzer/**/*.cpp') }}
38-
- name: node
39-
uses: actions/setup-node@v3
40-
with:
41-
node-version: ${{ matrix.node }}
42-
cache: "npm"
43-
- name: MSVC (windows)
44-
uses: ilammy/msvc-dev-cmd@v1
45-
if: contains(matrix.os, 'windows')
46-
- name: install dependencies
47-
run: npm ci
48-
- name: build project
49-
run: npm run build
50-
- name: build fuzzer
51-
if: ${{ steps.cache-fuzzer.outputs.cache-hit != 'true' }}
52-
run: npm run build --workspace=@jazzer.js/fuzzer
53-
- name: run all tests
54-
run: npm run test
5510
fuzz_tests:
5611
name: fuzz tests
5712
runs-on: ubuntu-latest
@@ -81,45 +36,3 @@ jobs:
8136
run: npm run build --workspace=@jazzer.js/fuzzer
8237
- name: run all fuzz tests
8338
run: node fuzztests/runFuzzTests.js
84-
end-to-end:
85-
name: end-to-end
86-
runs-on: ubuntu-latest
87-
steps:
88-
- name: checkout
89-
uses: actions/checkout@v3
90-
# Build with node.js 22
91-
- name: node
92-
uses: actions/setup-node@v3
93-
with:
94-
node-version: 22
95-
cache: "npm"
96-
- name: pack jazzer.js
97-
run: cd end-to-end && ./package-jazzer-js.sh
98-
- name: build example
99-
run: cd end-to-end && npm install --save-dev *.tgz && npm run build
100-
101-
# Run with different node.js versions
102-
# all in one job to avoid rebuilding
103-
- name: "node 14"
104-
uses: actions/setup-node@v3
105-
with:
106-
node-version: 14
107-
cache: "npm"
108-
- name: run tests
109-
run: cd end-to-end && npx jest
110-
111-
- name: "node 20"
112-
uses: actions/setup-node@v3
113-
with:
114-
node-version: 20
115-
cache: "npm"
116-
- name: run tests
117-
run: cd end-to-end && npx jest
118-
119-
- name: "node 24"
120-
uses: actions/setup-node@v3
121-
with:
122-
node-version: 24
123-
cache: "npm"
124-
- name: run tests
125-
run: cd end-to-end && npx jest

.github/workflows/run-all-tests-pr.yaml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,14 @@ jobs:
3939
strategy:
4040
matrix:
4141
os: [windows-latest, ubuntu-latest, macos-latest]
42-
# Test only latest LTS version in PRs
4342
node: [20]
43+
include:
44+
# Floor: legacy compatibility check
45+
- os: ubuntu-latest
46+
node: 14
47+
# Ceiling: current LTS
48+
- os: ubuntu-latest
49+
node: 24
4450
steps:
4551
- name: checkout
4652
uses: actions/checkout@v3
@@ -70,10 +76,53 @@ jobs:
7076
run: npm run build --workspace=@jazzer.js/fuzzer
7177
- name: run all tests
7278
run: npm run test
79+
end-to-end:
80+
name: end-to-end
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: checkout
84+
uses: actions/checkout@v3
85+
# Build with node.js 22
86+
- name: node
87+
uses: actions/setup-node@v3
88+
with:
89+
node-version: 22
90+
cache: "npm"
91+
- name: pack jazzer.js
92+
run: cd end-to-end && ./package-jazzer-js.sh
93+
- name: build example
94+
run: cd end-to-end && npm install --save-dev *.tgz && npm run build
95+
96+
# Run with different node.js versions
97+
# all in one job to avoid rebuilding
98+
- name: "node 14"
99+
uses: actions/setup-node@v3
100+
with:
101+
node-version: 14
102+
cache: "npm"
103+
- name: run tests
104+
run: cd end-to-end && npx jest
105+
106+
- name: "node 20"
107+
uses: actions/setup-node@v3
108+
with:
109+
node-version: 20
110+
cache: "npm"
111+
- name: run tests
112+
run: cd end-to-end && npx jest
113+
114+
- name: "node 24"
115+
uses: actions/setup-node@v3
116+
with:
117+
node-version: 24
118+
cache: "npm"
119+
- name: run tests
120+
run: cd end-to-end && npx jest
73121
auto-merge:
74122
needs:
75123
- linting
76124
- tests
125+
- end-to-end
77126
permissions:
78127
pull-requests: write
79128
contents: write

0 commit comments

Comments
 (0)