Skip to content

Commit 759cc64

Browse files
committed
chore(ci): shard efps tests
1 parent 5dd9195 commit 759cc64

File tree

2 files changed

+63
-9
lines changed

2 files changed

+63
-9
lines changed

.github/workflows/efps.yml

+62-9
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@ on:
1919
default: false
2020

2121
jobs:
22-
efps:
22+
efps-test:
2323
timeout-minutes: 30
2424
runs-on: ubuntu-latest
2525
env:
2626
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
2727
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
# Add more shards here if needed
32+
shardIndex: [1, 2, 3]
33+
shardTotal: [3]
2834
steps:
2935
- uses: actions/checkout@v4
3036
- uses: actions/setup-node@v4
@@ -84,18 +90,65 @@ jobs:
8490
REFERENCE_TAG: ${{ github.event.inputs.reference_tag || 'latest' }}
8591
ENABLE_PROFILER: ${{ github.event.inputs.enable_profiler || false }}
8692
RECORD_VIDEO: ${{ github.event.inputs.record_video || false }}
87-
run: pnpm efps:test
93+
run: pnpm efps:test -- -- --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
94+
95+
- uses: actions/upload-artifact@v3
96+
if: always()
97+
with:
98+
name: efps-report
99+
path: ${{ github.workspace }}/perf/efps/results/
100+
retention-days: 30
101+
102+
merge-reports:
103+
if: always()
104+
needs: [efps-test]
105+
runs-on: ubuntu-latest
106+
steps:
107+
- uses: actions/checkout@v4
108+
- uses: actions/setup-node@v4
109+
with:
110+
node-version: 18
111+
112+
- uses: pnpm/action-setup@v4
113+
name: Install pnpm
114+
id: pnpm-install
115+
with:
116+
run_install: false
117+
118+
- name: Get pnpm store directory
119+
id: pnpm-cache
120+
shell: bash
121+
run: |
122+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
123+
124+
- name: Cache node modules
125+
id: cache-node-modules
126+
uses: actions/cache@v4
127+
env:
128+
cache-name: cache-node-modules
129+
with:
130+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
131+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
132+
restore-keys: |
133+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
134+
v1-${{ runner.os }}-pnpm-store-
135+
v1-${{ runner.os }}-
136+
137+
- name: Install project dependencies
138+
run: pnpm install
139+
140+
- name: Download blob reports from Github Actions Artifacts
141+
uses: actions/download-artifact@v3
142+
with:
143+
name: efps-report
144+
path: perf/efps/results
145+
146+
- name: Write report
147+
run: pnpm efps:write:report
88148

89149
- name: PR comment with report
90150
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2
91151
if: ${{ github.event_name == 'pull_request' }}
92152
with:
93153
comment_tag: "efps-report"
94154
filePath: ${{ github.workspace }}/perf/efps/results/benchmark-results.md
95-
96-
- uses: actions/upload-artifact@v3
97-
if: always()
98-
with:
99-
name: efps-report
100-
path: perf/efps/results
101-
retention-days: 30

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"e2e:start": "pnpm --filter studio-e2e-testing preview",
5656
"etl": "node -r dotenv-flow/config -r esbuild-register scripts/etl",
5757
"efps:test": "cd perf/efps && pnpm test",
58+
"efps:write:report": "cd perf/efps && pnpm write:report",
5859
"example:blog-studio": "cd examples/blog-studio && pnpm start",
5960
"example:clean-studio": "cd examples/blog-studio && pnpm start",
6061
"example:ecommerce-studio": "cd examples/blog-studio && pnpm start",

0 commit comments

Comments
 (0)