Skip to content

Commit ff19f40

Browse files
committed
Update unit-tests.yml
Run all unit tests separately.
1 parent 4ab40b0 commit ff19f40

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

.github/workflows/unit-tests.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,39 @@ jobs:
1010
test:
1111
timeout-minutes: 30
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
unit: [
16+
cascading,
17+
comma,
18+
ignored,
19+
import,
20+
nth-child,
21+
selector
22+
]
1323
steps:
1424
- uses: actions/checkout@v3
1525
- uses: actions/setup-node@v3
1626
with:
1727
node-version: 18
18-
- name: Install Dependencies
28+
cache: 'npm'
29+
- name: Install dependencies
1930
run: npm ci
20-
- name: Install Test Server Dependencies
31+
- name: Install test server dependencies
2132
run: cd test-server && npm ci
22-
- name: Install Playwright Browsers
33+
- name: Get Playwright version
34+
id: playwright-version
35+
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV
36+
- name: Cache Playwright binaries
37+
uses: actions/cache@v3
38+
id: playwright-cache
39+
with:
40+
key: playwright-${{ env.PLAYWRIGHT_VERSION }}
41+
path: ~/.cache/ms-playwright
42+
- if: ${{ steps.playwright-cache.outputs.cache-hit != 'true' }}
43+
name: Install Playwright browsers
2344
run: npx playwright install --with-deps
24-
- name: Run Unit Tests
25-
run: npm run test
45+
- name: Build
46+
run: npm run build
47+
- name: Run ${{ matrix.unit }} unit test
48+
run: npx playwright test ${{ matrix.unit }}

0 commit comments

Comments
 (0)