Skip to content

Commit f5aae69

Browse files
committed
Add github workflow to run tests when code is merged to main branch
1 parent 4ffe337 commit f5aae69

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.github/workflows/run-tests.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: PR Check
13+
runs-on:
14+
labels: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup node
20+
uses: actions/setup-node@v4
21+
with:
22+
# renovate: node-version
23+
node-version: '18.19.1'
24+
25+
- name: Install Playwright Deps
26+
run: npx playwright install-deps chromium
27+
28+
- name: Install Libraries
29+
run: npm ci
30+
31+
- name: Run tests
32+
run: npm test
33+
34+
- name: Upload test results
35+
if: always()
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: playwright-test-results
39+
path: playwright-report
40+
# retention-days: 1

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"lint:fix": "cross-env eslint 'tests/**/*.ts' 'test-setup/**/*.ts' 'playwright.config.ts' '.eslintrc.js' --fix",
5151
"format": "cross-env prettier --write 'tests/**/*.ts' 'test-setup/**/*.ts' 'playwright.config.ts' '.eslintrc.js' '**/*.json' '**/*.md' '!package-lock.json' '!dist/**/*' '!build/**/*'",
5252
"prepare": "husky",
53-
"postinstall": "playwright install"
53+
"postinstall": "playwright install chromium"
5454
},
5555
"husky": {
5656
"hooks": {

0 commit comments

Comments
 (0)