Skip to content

Commit 281d55f

Browse files
author
lukaw3d
committed
Speedup CI: only build once before playwright shards
1 parent b1501ad commit 281d55f

1 file changed

Lines changed: 33 additions & 7 deletions

File tree

.github/workflows/ci-test.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,36 @@ jobs:
5656
path: coverage
5757
retention-days: 5
5858

59+
playwright-prepare:
60+
# NOTE: This name appears in GitHub's Checks API.
61+
name: playwright-prepare
62+
needs: [yarn_cache]
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Checkout code
66+
uses: actions/checkout@v4
67+
- name: Set up Node.js 18
68+
uses: actions/setup-node@v4
69+
with:
70+
node-version: '18.x'
71+
cache: yarn
72+
- name: Install dependencies
73+
run: yarn install --frozen-lockfile
74+
- run: REACT_APP_E2E_TEST=1 yarn build:ext
75+
- run: REACT_APP_E2E_TEST=1 yarn build
76+
- name: Upload builds for playwright
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: builds-for-playwright
80+
path: |
81+
./build
82+
./build-ext
83+
retention-days: 5
84+
5985
playwright:
6086
# NOTE: This name appears in GitHub's Checks API.
6187
name: playwright
62-
needs: [yarn_cache]
88+
needs: [playwright-prepare]
6389
runs-on: ubuntu-latest
6490
strategy:
6591
fail-fast: false
@@ -74,15 +100,15 @@ jobs:
74100
with:
75101
node-version: '18.x'
76102
cache: yarn
77-
# TODO: could move outside sharding: yarn + build:ext + build + upload
78-
# and then 8x shard download builds + serve + test
79-
- name: Install dependencies
80-
run: yarn install --frozen-lockfile
81-
- run: REACT_APP_E2E_TEST=1 yarn build:ext
82-
- run: REACT_APP_E2E_TEST=1 yarn start:prod &
103+
- uses: actions/download-artifact@v4
104+
- run: mv ./builds-for-playwright/build ./build
105+
- run: mv ./builds-for-playwright/build-ext ./build-ext
83106
- name: Install playwright's npm dependencies
84107
working-directory: ./playwright/
85108
run: yarn install --frozen-lockfile
109+
# outside sharding: yarn + build:ext + build + upload
110+
# and then 8x shard: download builds + serve + test
111+
- run: REACT_APP_E2E_TEST=1 node ./playwright/serve-prod.js &
86112
- name: Install playwright's system dependencies
87113
working-directory: ./playwright/
88114
run: npx playwright install --with-deps

0 commit comments

Comments
 (0)