1414 COVERAGE : ' 1'
1515 NODE_VERSION : ' 20.19.4'
1616
17- defaults :
18- run :
19- working-directory : packages/@lwc/integration-not-karma
20-
2117jobs :
2218 # We run tests in parallel to speed up CI, with an arbitrary goal of ~20 minutes per job.
23- # TODO: upload result artifacts
24-
2519 integration-tests :
2620 name : Integration tests (${{ matrix.shadow_mode }} shadow; ${{ matrix.env || 'default env' }})
2721 runs-on : ubuntu-22.04
@@ -71,12 +65,33 @@ jobs:
7165 node-version : ${{ env.NODE_VERSION }}
7266 cache : ' yarn'
7367
68+ - name : Get installed playwright version
69+ id : playwright-version
70+ run : |
71+ version="$(yarn --silent --json list --depth 0 playwright 2>/dev/null | jq -r '.data.trees[0].name|split("@")[1]')"
72+ echo "version=$version" >> "$GITHUB_OUTPUT"
73+
74+ - name : Restore playwright cache
75+ uses : actions/cache@v4
76+ with :
77+ path : |
78+ ~/.cache/ms-playwright
79+ key : ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}
80+
7481 - name : Install dependencies
7582 run : yarn install --frozen-lockfile
76- working-directory : ./
7783
7884 - name : Install playwright dependencies
85+ id : install-playwright
86+ continue-on-error : true
7987 run : yarn playwright install chrome firefox webkit --with-deps
88+ timeout-minutes : 3 # Sometimes seems to just hang forever? :|
89+
90+ # If installing playwright times out, wait 1 minute then try again
91+ - name : Install playwright dependencies (fallback)
92+ if : ${{ steps.install-playwright.outcome != 'success' }}
93+ run : sleep 60 && yarn playwright install chrome firefox webkit --with-deps
94+ timeout-minutes : 4
8095
8196 - name : Set env vars
8297 run : echo '${{ matrix.env }}' | tr ' ' '\n' >> "$GITHUB_ENV"
@@ -93,13 +108,24 @@ jobs:
93108 echo "NODE_ENV_FOR_TEST=$NODE_ENV_FOR_TEST"
94109
95110 - name : Run integration tests
111+ id : test-integration
112+ continue-on-error : true
96113 run : yarn test
114+ working-directory : packages/@lwc/integration-not-karma
115+
116+ # Because sometimes things are flaky
117+ - name : Run integration tests (fallback)
118+ if : ${{ steps.test-integration.outcome == 'failure' }}
119+ run : yarn run test
120+ working-directory : packages/@lwc/integration-not-karma
97121
98122 - name : Upload coverage report
99123 # Upload coverage even if the test step failed
100124 if : always()
101125 run : |
102- [ -f coverage/index.html ] && awk '/<table/,/<\/table>/' coverage/index.html >> "$GITHUB_STEP_SUMMARY"
126+ if [ -f coverage/index.html ]; then
127+ awk '/<table/,/<\/table>/' coverage/index.html >> "$GITHUB_STEP_SUMMARY"
128+ fi
103129
104130 hydration-tests :
105131 name : Hydration tests (${{ matrix.engine_server && 'engine-server' || 'SSR v2' }}; ${{ matrix.env || 'default env' }})
@@ -134,12 +160,33 @@ jobs:
134160 node-version : ${{ env.NODE_VERSION }}
135161 cache : ' yarn'
136162
163+ - name : Get installed playwright version
164+ id : playwright-version
165+ run : |
166+ version="$(yarn --silent --json list --depth 0 playwright 2>/dev/null | jq -r '.data.trees[0].name|split("@")[1]')"
167+ echo "version=$version" >> "$GITHUB_OUTPUT"
168+
169+ - name : Restore playwright cache
170+ uses : actions/cache@v4
171+ with :
172+ path : |
173+ ~/.cache/ms-playwright
174+ key : ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}
175+
137176 - name : Install dependencies
138177 run : yarn install --frozen-lockfile
139- working-directory : ./
140178
141179 - name : Install playwright dependencies
180+ id : install-playwright
181+ continue-on-error : true
142182 run : yarn playwright install chrome firefox webkit --with-deps
183+ timeout-minutes : 3 # Sometimes seems to just hang forever? :|
184+
185+ # If installing playwright times out, wait 1 minute then try again
186+ - name : Install playwright dependencies (fallback)
187+ if : ${{ steps.install-playwright.outcome != 'success' }}
188+ run : sleep 60 && yarn playwright install chrome firefox webkit --with-deps
189+ timeout-minutes : 4
143190
144191 - name : Set env vars
145192 run : echo '${{ matrix.env }}' | tr ' ' '\n' >> "$GITHUB_ENV"
@@ -154,10 +201,21 @@ jobs:
154201 echo "ENGINE_SERVER=$ENGINE_SERVER"
155202
156203 - name : Run hydration tests
157- run : yarn test:hydration
204+ id : test-hydration
205+ continue-on-error : true
206+ run : yarn run test:hydration
207+ working-directory : packages/@lwc/integration-not-karma
208+
209+ # Because sometimes things are flaky
210+ - name : Run hydration tests (fallback)
211+ if : ${{ steps.test-hydration.outcome == 'failure' }}
212+ run : yarn run test:hydration
213+ working-directory : packages/@lwc/integration-not-karma
158214
159215 - name : Upload coverage report
160216 # Upload coverage even if the test step failed
161217 if : always()
162218 run : |
163- [ -f coverage/index.html ] && awk '/<table/,/<\/table>/' coverage/index.html >> "$GITHUB_STEP_SUMMARY"
219+ if [ -f coverage/index.html ]; then
220+ awk '/<table/,/<\/table>/' coverage/index.html >> "$GITHUB_STEP_SUMMARY"
221+ fi
0 commit comments