88 test :
99 timeout-minutes : 60
1010 runs-on : ubuntu-latest
11+ strategy :
12+ fail-fast : false
13+ matrix :
14+ shard : [1, 2]
1115 services :
1216 falkordb :
1317 image : falkordb/falkordb:latest
@@ -32,10 +36,61 @@ jobs:
3236 run : |
3337 npm install
3438 npm run build
35- NEXTAUTH_SECRET=SECRET npm start & npx playwright test --reporter=dot,list
39+ NEXTAUTH_SECRET=SECRET npm start &
40+ npx playwright test --shard=${{ matrix.shard }}/2 --reporter=dot,list,json
3641 - uses : actions/upload-artifact@v4
3742 if : ${{ !cancelled() }}
3843 with :
39- name : playwright-report
44+ name : playwright-report-shard-${{ matrix.shard }}
4045 path : playwright-report/
4146 retention-days : 30
47+ - uses : actions/upload-artifact@v4
48+ if : ${{ !cancelled() }}
49+ with :
50+ name : test-results-shard-${{ matrix.shard }}
51+ path : test-results/
52+ retention-days : 30
53+
54+ merge-reports :
55+ if : ${{ !cancelled() }}
56+ needs : [test]
57+ runs-on : ubuntu-latest
58+ steps :
59+ - uses : actions/checkout@v4
60+ - uses : actions/setup-node@v4
61+ with :
62+ node-version : lts/*
63+ - name : Install dependencies
64+ run : npm ci
65+ - name : Download all test results
66+ uses : actions/download-artifact@v4
67+ with :
68+ path : all-test-results
69+ pattern : test-results-shard-*
70+ - name : Download all reports
71+ uses : actions/download-artifact@v4
72+ with :
73+ path : all-reports
74+ pattern : playwright-report-shard-*
75+ - name : Merge test results
76+ run : |
77+ # Create combined results directory
78+ mkdir -p combined-results
79+
80+ # Merge JSON results
81+ npx playwright merge-reports --reporter=html,json all-reports/playwright-report-shard-*/
82+
83+ # Move merged report to combined directory
84+ mv playwright-report combined-results/
85+
86+ # Create a summary of all test results
87+ echo "## Test Results Summary" > combined-results/summary.md
88+ echo "Total shards: 2" >> combined-results/summary.md
89+ echo "Workers per shard: 2" >> combined-results/summary.md
90+ echo "Generated on: $(date)" >> combined-results/summary.md
91+ - name : Upload combined report
92+ uses : actions/upload-artifact@v4
93+ with :
94+ name : combined-playwright-report
95+ path : combined-results/
96+ retention-days : 30
0 commit comments