Skip to content

Commit 3400753

Browse files
committed
chore(ci): shard efps tests
1 parent 090d68a commit 3400753

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
@@ -14,12 +14,18 @@ on:
1414
default: false
1515

1616
jobs:
17-
efps:
17+
efps-test:
1818
timeout-minutes: 30
1919
runs-on: ubuntu-latest
2020
env:
2121
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
2222
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
# Add more shards here if needed
27+
shardIndex: [1, 2, 3]
28+
shardTotal: [3]
2329
steps:
2430
- uses: actions/checkout@v4
2531
- uses: actions/setup-node@v4
@@ -78,18 +84,65 @@ jobs:
7884
PERF_EFPS_SANITY_TOKEN: ${{ secrets.PERF_EFPS_SANITY_TOKEN }}
7985
REFERENCE_TAG: ${{ github.event.inputs.reference_tag || 'latest' }}
8086
ENABLE_PROFILER: ${{ github.event.inputs.enable_profiler || false }}
81-
run: pnpm efps:test
87+
run: pnpm efps:test -- -- --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
88+
89+
- uses: actions/upload-artifact@v3
90+
if: always()
91+
with:
92+
name: efps-report
93+
path: ${{ github.workspace }}/perf/efps/results/
94+
retention-days: 30
95+
96+
merge-reports:
97+
if: always()
98+
needs: [efps-test]
99+
runs-on: ubuntu-latest
100+
steps:
101+
- uses: actions/checkout@v4
102+
- uses: actions/setup-node@v4
103+
with:
104+
node-version: 18
105+
106+
- uses: pnpm/action-setup@v4
107+
name: Install pnpm
108+
id: pnpm-install
109+
with:
110+
run_install: false
111+
112+
- name: Get pnpm store directory
113+
id: pnpm-cache
114+
shell: bash
115+
run: |
116+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
117+
118+
- name: Cache node modules
119+
id: cache-node-modules
120+
uses: actions/cache@v4
121+
env:
122+
cache-name: cache-node-modules
123+
with:
124+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
125+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
126+
restore-keys: |
127+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
128+
v1-${{ runner.os }}-pnpm-store-
129+
v1-${{ runner.os }}-
130+
131+
- name: Install project dependencies
132+
run: pnpm install
133+
134+
- name: Download blob reports from Github Actions Artifacts
135+
uses: actions/download-artifact@v3
136+
with:
137+
name: efps-report
138+
path: perf/efps/results
139+
140+
- name: Write report
141+
run: pnpm efps:write:report
82142

83143
- name: PR comment with report
84144
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2
85145
if: ${{ github.event_name == 'pull_request' }}
86146
with:
87147
comment_tag: "efps-report"
88148
filePath: ${{ github.workspace }}/perf/efps/results/benchmark-results.md
89-
90-
- uses: actions/upload-artifact@v3
91-
if: always()
92-
with:
93-
name: efps-report
94-
path: perf/efps/results
95-
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)