Skip to content

Commit 0a80060

Browse files
ci: split CI into one workflow per package
Pros: - tests on a package are only run if necessary - tests are run in parallel - one failing package does not fail the whole run - dependencies between packages are explicit Related: #5414
1 parent 1e2ae34 commit 0a80060

14 files changed

Lines changed: 711 additions & 121 deletions

.github/workflows/ci-browser.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CI (engine.io-client)
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
paths:
8+
- 'packages/engine.io/**'
9+
- 'packages/engine.io-client/**'
10+
- 'packages/engine.io-parser/**'
11+
- 'packages/socket.io-component-emitter/**'
12+
- '.github/workflows/ci-engine.io-client.yml'
13+
pull_request:
14+
paths:
15+
- 'packages/engine.io/**'
16+
- 'packages/engine.io-client/**'
17+
- 'packages/engine.io-parser/**'
18+
- 'packages/socket.io-component-emitter/**'
19+
- '.github/workflows/ci-engine.io-client.yml'
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
test:
26+
runs-on: ubuntu-latest
27+
timeout-minutes: 20
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v6
32+
33+
- name: Use Node.js 24
34+
uses: actions/setup-node@v6
35+
with:
36+
node-version: 24
37+
cache: npm
38+
39+
- name: Install dependencies
40+
run: npm ci
41+
42+
- name: Compile dependencies
43+
run: |
44+
npm run compile \
45+
--workspace=engine.io-parser
46+
47+
- name: Compile package
48+
run: npm run compile --workspace=engine.io-client
49+
50+
- name: Compile dev dependencies
51+
run: |
52+
npm run compile \
53+
--workspace=engine.io
54+
55+
- name: Run tests
56+
run: npm test --workspace=engine.io-client
57+
58+
- name: Run tests with fetch instead of XHR
59+
run: npm run test:node-fetch --workspace=engine.io-client
60+
61+
- name: Run tests with Node.js native WebSocket
62+
run: npm run test:node-builtin-ws --workspace=engine.io-client
63+
64+
# TODO: migrate tests from zuul to WebdriverIO
65+
# - name: Run tests in browser
66+
# if: github.event_name == 'push'
67+
# run: npm test --workspace=engine.io-client
68+
# env:
69+
# BROWSERS: 1
70+
# SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
71+
# SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI (engine.io-parser)
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
paths:
8+
- 'packages/engine.io-parser/**'
9+
- '.github/workflows/ci-engine.io-parser.yml'
10+
pull_request:
11+
paths:
12+
- 'packages/engine.io-parser/**'
13+
- '.github/workflows/ci-engine.io-parser.yml'
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
test:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 10
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v6
26+
27+
- name: Use Node.js 24
28+
uses: actions/setup-node@v6
29+
with:
30+
node-version: 24
31+
cache: npm
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Compile package
37+
run: npm run compile --workspace=engine.io-parser
38+
39+
- name: Run tests
40+
run: npm test --workspace=engine.io-parser
41+
42+
# TODO: migrate tests from zuul to WebdriverIO
43+
# - name: Run browser tests
44+
# if: github.event_name == 'push'
45+
# run: npm test --workspace=engine.io-parser
46+
# env:
47+
# BROWSERS: 1
48+
# SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
49+
# SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}

.github/workflows/ci-engine.io.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI (engine.io)
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
paths:
8+
- 'packages/engine.io/**'
9+
- 'packages/engine.io-client/**'
10+
- 'packages/engine.io-parser/**'
11+
- 'packages/socket.io-component-emitter/**'
12+
- '.github/workflows/ci-engine.io.yml'
13+
pull_request:
14+
paths:
15+
- 'packages/engine.io/**'
16+
- 'packages/engine.io-client/**'
17+
- 'packages/engine.io-parser/**'
18+
- 'packages/socket.io-component-emitter/**'
19+
- '.github/workflows/ci-engine.io.yml'
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
test:
26+
runs-on: ubuntu-latest
27+
timeout-minutes: 10
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v6
32+
33+
- name: Use Node.js 24
34+
uses: actions/setup-node@v6
35+
with:
36+
node-version: 24
37+
cache: npm
38+
39+
- name: Install dependencies
40+
run: npm ci
41+
42+
- name: Compile dependencies
43+
run: |
44+
npm run compile \
45+
--workspace=engine.io-parser
46+
47+
- name: Compile package
48+
run: npm run compile --workspace=engine.io
49+
50+
- name: Compile dev dependencies
51+
run: |
52+
npm run compile \
53+
--workspace=engine.io-client
54+
55+
- name: Run tests
56+
run: npm test --workspace=engine.io
57+
58+
- name: Run tests with uws
59+
run: npm run test:uws --workspace=engine.io
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI (socket.io-adapter)
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
paths:
8+
- 'packages/socket.io-adapter/**'
9+
- '.github/workflows/ci-socket.io-adapter.yml'
10+
pull_request:
11+
paths:
12+
- 'packages/socket.io-adapter/**'
13+
- '.github/workflows/ci-socket.io-adapter.yml'
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
test:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 10
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v6
26+
27+
- name: Use Node.js 24
28+
uses: actions/setup-node@v6
29+
with:
30+
node-version: 24
31+
cache: npm
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Compile package
37+
run: npm run compile --workspace=socket.io-adapter
38+
39+
- name: Compile dev dependencies
40+
run: |
41+
npm run compile \
42+
--workspace=engine.io-parser \
43+
--workspace=engine.io-client \
44+
--workspace=engine.io \
45+
--workspace=socket.io-parser \
46+
--workspace=socket.io-client \
47+
--workspace=socket.io
48+
49+
- name: Run tests
50+
run: npm test --workspace=socket.io-adapter
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI (socket.io-client))
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
paths:
8+
- 'packages/engine.io/**'
9+
- 'packages/engine.io-client/**'
10+
- 'packages/engine.io-parser/**'
11+
- 'packages/socket.io/**'
12+
- 'packages/socket.io-adapter/**'
13+
- 'packages/socket.io-client/**'
14+
- 'packages/socket.io-component-emitter/**'
15+
- 'packages/socket.io-parser/**'
16+
- '.github/workflows/ci-socket.io-client.yml'
17+
pull_request:
18+
paths:
19+
- 'packages/engine.io/**'
20+
- 'packages/engine.io-client/**'
21+
- 'packages/engine.io-parser/**'
22+
- 'packages/socket.io/**'
23+
- 'packages/socket.io-adapter/**'
24+
- 'packages/socket.io-client/**'
25+
- 'packages/socket.io-component-emitter/**'
26+
- 'packages/socket.io-parser/**'
27+
- '.github/workflows/ci-socket.io-client.yml'
28+
29+
permissions:
30+
contents: read
31+
32+
jobs:
33+
test:
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 20
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v6
40+
41+
- name: Use Node.js 24
42+
uses: actions/setup-node@v6
43+
with:
44+
node-version: 24
45+
cache: npm
46+
47+
- name: Install dependencies
48+
run: npm ci
49+
50+
- name: Compile dependencies
51+
run: |
52+
npm run compile \
53+
--workspace=engine.io-parser \
54+
--workspace=engine.io-client \
55+
--workspace=socket.io-parser
56+
57+
- name: Compile package
58+
run: npm run compile --workspace=socket.io-client
59+
60+
- name: Compile dev dependencies
61+
run: |
62+
npm run compile \
63+
--workspace=engine.io \
64+
--workspace=socket.io-adapter \
65+
--workspace=socket.io
66+
67+
- name: Run tests
68+
run: npm test --workspace=socket.io-client
69+
70+
- name: Run browser tests
71+
if: github.event_name == 'push'
72+
run: npm test --workspace=socket.io-client
73+
env:
74+
BROWSERS: 1
75+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
76+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}

0 commit comments

Comments
 (0)