Skip to content

Commit eeab56f

Browse files
committed
chore(ci): optimize test workflow
- add Playwright browser caching - upload artifacts on all runs (always()) - add job timeout safeguard - allow non-blocking lint step - clean up paths-ignore rules
1 parent 6da6d31 commit eeab56f

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
- main
77
paths-ignore:
88
- '**.md'
9-
- '**.yml'
109
pull_request:
1110
branches:
1211
- main
@@ -21,6 +20,8 @@ jobs:
2120
test:
2221
name: Test
2322
runs-on: ubuntu-latest
23+
timeout-minutes: 10
24+
2425
steps:
2526
- name: Checkout repository
2627
uses: actions/checkout@v6
@@ -30,15 +31,25 @@ jobs:
3031
with:
3132
node-version-file: 'package.json'
3233
cache: 'npm'
34+
cache-dependency-path: package-lock.json
3335

3436
- name: Install dependencies
35-
run: npm ci
37+
run: npm ci --prefer-offline --no-audit
38+
39+
- name: Cache Playwright browsers
40+
id: playwright-cache
41+
uses: actions/cache@v5.0.3
42+
with:
43+
path: ~/.cache/ms-playwright
44+
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}-${{ hashFiles('**/playwright.config.*') }}
3645

37-
- name: Install Playwright Browser
46+
- name: Install Playwright browsers
47+
if: steps.playwright-cache.outputs.cache-hit != 'true'
3848
run: npx playwright install chromium
3949

4050
- name: Code quality
4151
run: npm run lint
52+
continue-on-error: true
4253

4354
- name: Build
4455
run: npm run build
@@ -47,7 +58,7 @@ jobs:
4758
run: npm run test
4859

4960
- uses: actions/upload-artifact@v7
50-
if: ${{ !cancelled() }}
61+
if: ${{ always() }}
5162
with:
5263
name: playwright-report
5364
path: playwright-report/

0 commit comments

Comments
 (0)