Skip to content

Commit c722478

Browse files
authored
chore(CI): run benchmark daily and manually (#608)
1 parent eb04736 commit c722478

File tree

4 files changed

+54
-43
lines changed

4 files changed

+54
-43
lines changed

.github/workflows/benchmark.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Benchmark
2+
3+
on:
4+
schedule:
5+
- cron: '0 1 * * *' # 01:00 UTC
6+
workflow_dispatch:
7+
inputs:
8+
ref:
9+
description: 'head to bench (input branch, tag or SHA)'
10+
required: true
11+
default: 'main'
12+
13+
jobs:
14+
benchmark:
15+
# Only Ubuntu 20.04 and 22.04 are supported at the moment.
16+
# See https://github.com/CodSpeedHQ/action/blob/016456b513677f9d4a1c509c7f8a38d8dd55b2b0/.github/workflows/ci.yml#L19.
17+
runs-on: ubuntu-22.04
18+
strategy:
19+
matrix:
20+
node-version: [20]
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 10
27+
ref: ${{ inputs.ref || 'main' }}
28+
29+
- name: Install pnpm
30+
run: corepack enable
31+
32+
- name: Setup Node.js ${{ matrix.node-version }}
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
cache: 'pnpm'
37+
38+
- name: Install Dependencies
39+
run: pnpm install && cd ./tests && pnpm playwright install chromium
40+
41+
# only run benchmark in Ubuntu
42+
- name: Benchmarks (Vitest)
43+
uses: CodSpeedHQ/action@v3
44+
with:
45+
run: pnpm run test:benchmark
46+
# token retrieved from the CodSpeed app at the previous step
47+
token: ${{ secrets.CODSPEED_TOKEN }}

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
fetch-depth: 1
2121

22-
- name: Install Pnpm
22+
- name: Install pnpm
2323
run: corepack enable
2424

2525
- name: Setup Node.js
@@ -37,5 +37,5 @@ jobs:
3737
- name: Check Dependency Version
3838
run: pnpm run check-dependency-version
3939

40-
- name: Check Pnpm Dedupe
40+
- name: Check pnpm Dedupe
4141
run: pnpm dedupe --check

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
fetch-depth: 1
3737
ref: ${{ github.event.inputs.branch }}
3838

39-
- name: Install Pnpm
39+
- name: Install pnpm
4040
run: corepack enable
4141

4242
- name: Setup Node.js

.github/workflows/test.yml

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
fetch-depth: 10
2727

28-
- name: Install Pnpm
28+
- name: Install pnpm
2929
run: corepack enable
3030

3131
- uses: dorny/[email protected]
@@ -64,7 +64,7 @@ jobs:
6464
run: |
6565
git config --system core.longpaths true
6666
67-
- name: Install Pnpm
67+
- name: Install pnpm
6868
run: corepack enable
6969

7070
- name: Setup Node.js ${{ matrix.node-version }}
@@ -104,7 +104,7 @@ jobs:
104104
with:
105105
fetch-depth: 10
106106

107-
- name: Install Pnpm
107+
- name: Install pnpm
108108
run: corepack enable
109109

110110
- name: Setup Node.js ${{ matrix.node-version }}
@@ -122,46 +122,10 @@ jobs:
122122
- name: E2E Test (Playwright)
123123
run: pnpm run test:e2e
124124

125-
# ======== benchmark ========
126-
benchmark:
127-
# Only Ubuntu 20.04 and 22.04 are supported at the moment.
128-
# See https://github.com/CodSpeedHQ/action/blob/016456b513677f9d4a1c509c7f8a38d8dd55b2b0/.github/workflows/ci.yml#L19.
129-
runs-on: ubuntu-22.04
130-
needs: [integration-e2e]
131-
strategy:
132-
matrix:
133-
node-version: [20]
134-
135-
steps:
136-
- name: Checkout
137-
uses: actions/checkout@v4
138-
with:
139-
fetch-depth: 10
140-
141-
- name: Install Pnpm
142-
run: corepack enable
143-
144-
- name: Setup Node.js ${{ matrix.node-version }}
145-
uses: actions/setup-node@v4
146-
with:
147-
node-version: ${{ matrix.node-version }}
148-
cache: 'pnpm'
149-
150-
- name: Install Dependencies
151-
run: pnpm install && cd ./tests && pnpm playwright install chromium
152-
153-
# only run benchmark in Ubuntu
154-
- name: Benchmarks (Vitest)
155-
uses: CodSpeedHQ/action@v3
156-
with:
157-
run: pnpm run test:benchmark
158-
# token retrieved from the CodSpeed app at the previous step
159-
token: ${{ secrets.CODSPEED_TOKEN }}
160-
161125
# ======== exit ========
162126
pr-check-required:
163127
if: (!cancelled() && !failure())
164-
needs: [ut, integration-e2e, benchmark]
128+
needs: [ut, integration-e2e]
165129
runs-on: ubuntu-latest
166130
name: Test passed or skipped
167131
steps:

0 commit comments

Comments
 (0)