Skip to content

Commit e946754

Browse files
committed
ci: clean up and lock benchmark node version
1 parent 93d150d commit e946754

File tree

5 files changed

+94
-55
lines changed

5 files changed

+94
-55
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
- name: Install Pnpm
3131
run: corepack enable
3232

33-
- name: Setup Node.js 18.x
33+
- name: Setup Node.js 18
3434
uses: actions/setup-node@v4
3535
with:
36-
node-version: 18.x
36+
node-version: 18
3737
cache: 'pnpm'
3838

3939
- name: Install Dependencies

.github/workflows/release-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Setup Node.js 18
3333
uses: actions/setup-node@v4
3434
with:
35-
node-version: '18'
35+
node-version: 18
3636
cache: 'pnpm'
3737

3838
- name: Install Dependencies

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup Node.js 18
4141
uses: actions/setup-node@v4
4242
with:
43-
node-version: '18'
43+
node-version: 18
4444
cache: 'pnpm'
4545

4646
- name: Install Dependencies

.github/workflows/test-ubuntu.yml

Lines changed: 56 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ on:
1616

1717
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1818
jobs:
19-
# ======== ut ========
20-
ut-ubuntu:
19+
# ======== caculate changes ========
20+
changes:
2121
runs-on: ubuntu-latest
22+
outputs:
23+
changed: ${{ steps.changes.outputs.changed }}
2224
strategy:
2325
matrix:
24-
node-version: [18.x]
26+
node-version: [18]
2527

2628
# Steps represent a sequence of tasks that will be executed as part of the job
2729
steps:
@@ -44,27 +46,45 @@ jobs:
4446
- "!**/_meta.json"
4547
- "!**/dictionary.txt"
4648
49+
# ======== ut ========
50+
ut-ubuntu:
51+
runs-on: ubuntu-latest
52+
needs: changes
53+
if: ${{ needs.changes.outputs.changed == 'true' }}
54+
strategy:
55+
matrix:
56+
node-version: [18, 20, 22]
57+
58+
# Steps represent a sequence of tasks that will be executed as part of the job
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
with:
63+
fetch-depth: 10
64+
65+
- name: Install Pnpm
66+
run: corepack enable
67+
4768
- name: Setup Node.js ${{ matrix.node-version }}
48-
if: steps.changes.outputs.changed == 'true'
4969
uses: actions/setup-node@v4
5070
with:
5171
node-version: ${{ matrix.node-version }}
5272
cache: 'pnpm'
5373

5474
- name: Install Dependencies
55-
if: steps.changes.outputs.changed == 'true'
5675
run: pnpm install
5776

5877
- name: Unit Test
59-
if: steps.changes.outputs.changed == 'true'
6078
run: pnpm run test:unit
6179

6280
# ======== integration && e2e ========
6381
integration-e2e-ubuntu:
6482
runs-on: ubuntu-latest
83+
needs: changes
84+
if: ${{ needs.changes.outputs.changed == 'true' }}
6585
strategy:
6686
matrix:
67-
node-version: [18.x]
87+
node-version: [18, 20, 22]
6888

6989
# Steps represent a sequence of tasks that will be executed as part of the job
7090
steps:
@@ -76,40 +96,53 @@ jobs:
7696
- name: Install Pnpm
7797
run: corepack enable
7898

79-
- uses: dorny/paths-filter@v3
80-
id: changes
81-
with:
82-
predicate-quantifier: 'every'
83-
filters: |
84-
changed:
85-
- "!**/*.md"
86-
- "!**/*.mdx"
87-
- "!**/_meta.json"
88-
- "!**/dictionary.txt"
89-
9099
- name: Setup Node.js ${{ matrix.node-version }}
91-
if: steps.changes.outputs.changed == 'true'
92100
uses: actions/setup-node@v4
93101
with:
94102
node-version: ${{ matrix.node-version }}
95103
cache: 'pnpm'
96104

97105
- name: Install Dependencies
98-
if: steps.changes.outputs.changed == 'true'
99106
run: pnpm install && cd ./tests && npx playwright install
100107

101108
- name: Integration Test (Vitest)
102-
if: steps.changes.outputs.changed == 'true'
103109
run: pnpm run test:integration
104110

105111
- name: E2E Test (Playwright)
106-
if: steps.changes.outputs.changed == 'true'
107112
run: pnpm run test:e2e
108113

114+
# ======== benchmark ========
115+
benchemark-ubuntu:
116+
# Only Ubuntu 20.04 and 22.04 are supported at the moment.
117+
# See https://github.com/CodSpeedHQ/action/blob/016456b513677f9d4a1c509c7f8a38d8dd55b2b0/.github/workflows/ci.yml#L19.
118+
runs-on: ubuntu-22.04
119+
needs: [integration-e2e-ubuntu]
120+
strategy:
121+
matrix:
122+
node-version: [20]
123+
124+
# Steps represent a sequence of tasks that will be executed as part of the job
125+
steps:
126+
- name: Checkout
127+
uses: actions/checkout@v4
128+
with:
129+
fetch-depth: 10
130+
131+
- name: Install Pnpm
132+
run: corepack enable
133+
134+
- name: Setup Node.js ${{ matrix.node-version }}
135+
uses: actions/setup-node@v4
136+
with:
137+
node-version: ${{ matrix.node-version }}
138+
cache: 'pnpm'
139+
140+
- name: Install Dependencies
141+
run: pnpm install && cd ./tests && npx playwright install
142+
109143
# only run benchmark in Ubuntu
110144
- name: Benchmarks (Vitest)
111145
uses: CodSpeedHQ/action@v3
112-
if: steps.changes.outputs.changed == 'true'
113146
with:
114147
run: pnpm run test:benchmark
115148
# token retrieved from the CodSpeed app at the previous step

.github/workflows/test-windows.yml

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,17 @@ on:
1616

1717
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1818
jobs:
19-
# ======== ut ========
20-
ut-windows:
19+
# ======== caculate changes ========
20+
changes:
2121
runs-on: windows-latest
22+
outputs:
23+
changed: ${{ steps.changes.outputs.changed }}
2224
strategy:
2325
matrix:
24-
node-version: [18.x]
26+
node-version: [18]
2527

2628
# Steps represent a sequence of tasks that will be executed as part of the job
2729
steps:
28-
- name: Git config
29-
shell: bash
30-
run: |
31-
git config --system core.longpaths true
32-
3330
- name: Checkout
3431
uses: actions/checkout@v4
3532
with:
@@ -49,27 +46,50 @@ jobs:
4946
- "!**/_meta.json"
5047
- "!**/dictionary.txt"
5148
49+
# ======== ut ========
50+
ut-windows:
51+
runs-on: windows-latest
52+
needs: changes
53+
if: ${{ needs.changes.outputs.changed == 'true' }}
54+
strategy:
55+
matrix:
56+
node-version: [18]
57+
58+
# Steps represent a sequence of tasks that will be executed as part of the job
59+
steps:
60+
- name: Git config
61+
shell: bash
62+
run: |
63+
git config --system core.longpaths true
64+
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
with:
68+
fetch-depth: 10
69+
70+
- name: Install Pnpm
71+
run: corepack enable
72+
5273
- name: Setup Node.js ${{ matrix.node-version }}
53-
if: steps.changes.outputs.changed == 'true'
5474
uses: actions/setup-node@v4
5575
with:
5676
node-version: ${{ matrix.node-version }}
5777
cache: 'pnpm'
5878

5979
- name: Install Dependencies
60-
if: steps.changes.outputs.changed == 'true'
6180
run: pnpm install
6281

6382
- name: Unit Test
64-
if: steps.changes.outputs.changed == 'true'
6583
run: pnpm run test:unit
6684

67-
# # ======== integration && e2e ========
85+
# ======== integration && e2e ========
6886
integration-e2e-windows:
6987
runs-on: windows-latest
88+
needs: changes
89+
if: ${{ needs.changes.outputs.changed == 'true' }}
7090
strategy:
7191
matrix:
72-
node-version: [18.x]
92+
node-version: [18]
7393

7494
# Steps represent a sequence of tasks that will be executed as part of the job
7595
steps:
@@ -86,31 +106,17 @@ jobs:
86106
- name: Install Pnpm
87107
run: corepack enable
88108

89-
- uses: dorny/paths-filter@v3
90-
id: changes
91-
with:
92-
predicate-quantifier: 'every'
93-
filters: |
94-
changed:
95-
- "!**/*.md"
96-
- "!**/*.mdx"
97-
- "!**/_meta.json"
98-
- "!**/dictionary.txt"
99-
100109
- name: Setup Node.js ${{ matrix.node-version }}
101-
if: steps.changes.outputs.changed == 'true'
102110
uses: actions/setup-node@v4
103111
with:
104112
node-version: ${{ matrix.node-version }}
105113
cache: 'pnpm'
114+
106115
- name: Install Dependencies
107-
if: steps.changes.outputs.changed == 'true'
108116
run: pnpm install && cd ./tests && npx playwright install
109117

110118
- name: Integration Test (Vitest)
111-
if: steps.changes.outputs.changed == 'true'
112119
run: pnpm run test:integration
113120

114121
- name: E2E Test (Playwright)
115-
if: steps.changes.outputs.changed == 'true'
116122
run: pnpm run test:e2e

0 commit comments

Comments
 (0)