File tree Expand file tree Collapse file tree 3 files changed +29
-4
lines changed Expand file tree Collapse file tree 3 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 14
14
default : 3
15
15
16
16
jobs :
17
+ prepare-shards :
18
+ runs-on : ubuntu-latest
19
+ outputs :
20
+ shard-array : ${{ steps.generate-shards.outputs.shard-array }}
21
+ steps :
22
+ - name : Generate shard array
23
+ id : generate-shards
24
+ run : |
25
+ shards=$(seq 1 ${{ inputs.shard-total }} | jq -s -c 'map(tonumber)')
26
+ echo "shard-array=$shards" >> $GITHUB_OUTPUT
27
+
17
28
test :
29
+ needs : prepare-shards
18
30
runs-on : ubuntu-latest
19
31
strategy :
20
32
matrix :
21
33
include : ${{ fromJson(inputs.matrix-include) }}
22
- shard : [1, 2, 3]
34
+ shard : ${{ fromJson(needs.prepare-shards.outputs.shard-array) }}
23
35
name : Test ${{ matrix.locale }} (Shard ${{ matrix.shard }})
24
36
steps :
25
37
- name : Checkout code
37
49
vercel_org_id : ${{ secrets.VERCEL_ORG_ID }}
38
50
vercel_token : ${{ secrets.VERCEL_TOKEN }}
39
51
40
- - name : Run E2E Tests
52
+ - uses : ./.github/actions/vercel-build
53
+ with :
54
+ environment : production
55
+ prodFlag : --prod
56
+ vercel_project_id : ${{ secrets[matrix.secret_project_id] }}
57
+ vercel_org_id : ${{ secrets.VERCEL_ORG_ID }}
58
+ vercel_token : ${{ secrets.VERCEL_TOKEN }}
59
+
60
+ - name : Install E2E Dependencies
41
61
run : |
42
62
pnpm --filter @next-i18n/docs playwright:install
63
+
64
+ - name : Run E2E Tests
65
+ run : |
43
66
echo "Running tests for ${{ matrix.locale }} (Shard ${{ matrix.shard }}/${{ inputs.shard-total }})"
44
67
pnpm --filter @next-i18n/docs test:e2e --shard ${{ matrix.shard }}/${{ inputs.shard-total }}
Original file line number Diff line number Diff line change 31
31
uses : ./.github/workflows/test-e2e.yml
32
32
with :
33
33
matrix-include : ${{ needs.check-changes.outputs.matrix-include }}
34
- shard-total : 3
34
+ shard-total : 5
35
35
secrets : inherit
36
36
37
37
deploy-and-update-index :
Original file line number Diff line number Diff line change
1
+ import env from '@next/env' ;
1
2
import { defineConfig , devices } from '@playwright/test' ;
3
+ env . loadEnvConfig ( process . cwd ( ) ) ;
2
4
3
5
export default defineConfig ( {
4
6
testDir : './tests/e2e' ,
@@ -18,7 +20,7 @@ export default defineConfig({
18
20
} ,
19
21
] ,
20
22
webServer : {
21
- command : 'pnpm dev --port 7878' ,
23
+ command : 'pnpm start --port 7878' ,
22
24
url : 'http://localhost:7878' ,
23
25
reuseExistingServer : ! process . env . CI ,
24
26
timeout : 120 * 1000 ,
You can’t perform that action at this time.
0 commit comments