@@ -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,23 +89,71 @@ 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 : Cache build artifacts
107+ uses : actions/cache/save@v4
108+ with :
109+ path : |
110+ packages/*/dist
111+ playground/dist
112+ node_modules
113+ packages/*/node_modules
114+ key : playwright-build-${{ github.sha }}
115+
116+ playwright :
117+ name : " Playwright Tests - ${{ matrix.browser }} (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})"
118+ runs-on : ubuntu-latest
119+ needs : playwright-build
120+ timeout-minutes : 30
121+ container :
122+ image : mcr.microsoft.com/playwright:v1.51.1-noble
123+ strategy :
124+ fail-fast : false
125+ matrix :
126+ browser : [chromium, firefox, webkit]
127+ shardIndex : [1, 2]
128+ shardTotal : [2]
129+ steps :
130+ - uses : actions/checkout@v4
131+ with :
132+ fetch-depth : 100
133+
134+ - name : Install pnpm
135+ uses : pnpm/action-setup@v4
136+
137+ - uses : actions/setup-node@v4
138+ with :
139+ cache : " pnpm"
140+ cache-dependency-path : " **/pnpm-lock.yaml"
141+ node-version-file : " .nvmrc"
142+
143+ - name : Restore build artifacts
144+ uses : actions/cache/restore@v4
145+ with :
146+ path : |
147+ packages/*/dist
148+ playground/dist
149+ node_modules
150+ packages/*/node_modules
151+ key : playwright-build-${{ github.sha }}
152+ fail-on-cache-miss : true
153+
112154 - name : Run server and Playwright tests
113155 run : |
114- HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }}" pnpm run e2e
156+ HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} " pnpm run e2e
115157
116158 - name : Upload blob report
117159 uses : actions/upload-artifact@v4
@@ -125,7 +167,7 @@ jobs:
125167 uses : actions/upload-artifact@v4
126168 if : ${{ !cancelled() }}
127169 with :
128- name : playwright-report-${{ matrix.browser }}
170+ name : playwright-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
129171 path : tests/playwright-report/
130172 retention-days : 30
131173
@@ -152,7 +194,7 @@ jobs:
152194 - name : Download blob reports
153195 uses : actions/download-artifact@v4
154196 with :
155- path : all-blob-reports
197+ path : tests/ all-blob-reports
156198 pattern : blob-report-*
157199 merge-multiple : true
158200
0 commit comments