Skip to content

Commit a9f08bc

Browse files
committed
ci: add GitHub Actions workflow for automated testing on PRs
1 parent f983ab4 commit a9f08bc

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/test.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
push:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run unit tests
31+
run: npm test
32+
33+
- name: Run build
34+
run: npm run build
35+
36+
- name: Install Playwright browsers
37+
run: npx playwright install
38+
39+
- name: Run E2E tests
40+
run: npm run test:e2e
41+
42+
- name: Upload test results
43+
uses: actions/upload-artifact@v4
44+
if: failure()
45+
with:
46+
name: test-results-${{ matrix.node-version }}
47+
path: |
48+
test-results/
49+
playwright-report/

0 commit comments

Comments
 (0)