Skip to content

Commit 0512a8a

Browse files
committed
Add GitHub Actions workflow for running tests
1 parent bec0606 commit 0512a8a

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run Jest Tests
2+
3+
on:
4+
push:
5+
branches: [ '**' ] # Run on all branches
6+
pull_request:
7+
branches: [ '**' ] # Run on PRs targeting any branch
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [14, 16, 18]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run tests
30+
run: npm test
31+
32+
- name: Upload test results
33+
if: always()
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: test-results-${{ matrix.node-version }}
37+
path: |
38+
coverage/
39+
test-results/

0 commit comments

Comments
 (0)