Skip to content

Commit 57b5261

Browse files
committed
Add GitHub action to run tests for PRs
1 parent 1cdbf9f commit 57b5261

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
cache: 'npm'
24+
25+
- name: Set up Firefox Nightly
26+
uses: browser-actions/setup-firefox@v1
27+
with:
28+
firefox-version: latest-nightly
29+
30+
- name: Verify Firefox Nightly installation
31+
run: firefox --version
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Run tests
37+
run: FIREFOX_BINARY=firefox npm test
38+
39+
- name: Upload screenshots on failure
40+
if: failure()
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: test-screenshots
44+
path: test/screenshots/
45+
if-no-files-found: ignore

0 commit comments

Comments
 (0)