@@ -65,16 +65,10 @@ jobs:
6565 id : soft-release
6666 run : pnpx pkg-pr-new publish './packages/*' # TODO disabled only for AI branch--compact
6767
68- playwright :
69- name : " Playwright Tests - ${{ matrix.browser }} "
68+ playwright-build :
69+ name : " Playwright Build "
7070 runs-on : ubuntu-latest
71- timeout-minutes : 60
72- container :
73- image : mcr.microsoft.com/playwright:v1.51.1-noble
74- strategy :
75- fail-fast : false
76- matrix :
77- browser : [chromium, firefox, webkit]
71+ timeout-minutes : 30
7872 steps :
7973 - uses : actions/checkout@v4
8074 with :
@@ -95,27 +89,118 @@ jobs:
9589 uses : actions/cache@v4
9690 with :
9791 path : .nx/cache
98- key : nx-${{ matrix.browser }} -${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }}
92+ key : nx-playwright -${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }}
9993 restore-keys : |
100- nx-${{ matrix.browser }} -${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-
101- nx-${{ matrix.browser }} -${{ env.NX_BRANCH }}-
94+ nx-playwright -${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-
95+ nx-playwright -${{ env.NX_BRANCH }}-
10296 nx-
10397
104- - run : apt-get update && apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config
98+ - run : sudo apt-get update && sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config
10599
106100 - name : Install dependencies
107101 run : pnpm install
108102
109103 - name : Build packages
110104 run : pnpm run build
111105
106+ - name : Upload build artifacts
107+ uses : actions/upload-artifact@v4
108+ with :
109+ name : playwright-build
110+ path : |
111+ packages/*/dist
112+ playground/dist
113+ retention-days : 1
114+
115+ playwright :
116+ name : " Playwright Tests - ${{ matrix.browser }} (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})"
117+ runs-on : ubuntu-latest
118+ needs : playwright-build
119+ timeout-minutes : 30
120+ container :
121+ image : mcr.microsoft.com/playwright:v1.51.1-noble
122+ strategy :
123+ fail-fast : false
124+ matrix :
125+ browser : [chromium, firefox, webkit]
126+ shardIndex : [1, 2]
127+ shardTotal : [2]
128+ steps :
129+ - uses : actions/checkout@v4
130+ with :
131+ fetch-depth : 100
132+
133+ - name : Install pnpm
134+ uses : pnpm/action-setup@v4
135+
136+ - uses : actions/setup-node@v4
137+ with :
138+ cache : " pnpm"
139+ cache-dependency-path : " **/pnpm-lock.yaml"
140+ node-version-file : " .nvmrc"
141+
142+ - name : Download build artifacts
143+ uses : actions/download-artifact@v4
144+ with :
145+ name : playwright-build
146+
147+ - name : Install dependencies
148+ run : pnpm install
149+
112150 - name : Run server and Playwright tests
113151 run : |
114- HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }}" pnpm run e2e
152+ HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}" pnpm run e2e
153+
154+ - name : Upload blob report
155+ uses : actions/upload-artifact@v4
156+ if : ${{ !cancelled() }}
157+ with :
158+ name : blob-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
159+ path : tests/blob-report/
160+ retention-days : 1
161+
162+ - name : Upload HTML report
163+ uses : actions/upload-artifact@v4
164+ if : ${{ !cancelled() }}
165+ with :
166+ name : playwright-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
167+ path : tests/playwright-report/
168+ retention-days : 30
169+
170+ merge-reports :
171+ name : " Merge Playwright Reports"
172+ if : ${{ !cancelled() }}
173+ needs : playwright
174+ runs-on : ubuntu-latest
175+ steps :
176+ - uses : actions/checkout@v4
177+
178+ - name : Install pnpm
179+ uses : pnpm/action-setup@v4
180+
181+ - uses : actions/setup-node@v4
182+ with :
183+ cache : " pnpm"
184+ cache-dependency-path : " **/pnpm-lock.yaml"
185+ node-version-file : " .nvmrc"
186+
187+ - name : Install dependencies
188+ run : pnpm install
189+
190+ - name : Download blob reports
191+ uses : actions/download-artifact@v4
192+ with :
193+ path : tests/all-blob-reports
194+ pattern : blob-report-*
195+ merge-multiple : true
196+
197+ - name : Merge reports
198+ run : npx playwright merge-reports --reporter html ./all-blob-reports
199+ working-directory : tests
115200
116- - uses : actions/upload-artifact@v4
117- if : always()
201+ - name : Upload merged HTML report
202+ uses : actions/upload-artifact@v4
118203 with :
119- name : playwright-report-${{ matrix.browser }}
204+ name : playwright-report-merged
120205 path : tests/playwright-report/
121206 retention-days : 30
0 commit comments