Skip to content

Commit 54ca812

Browse files
committed
Add GitHub Actions workflow for running tests and uploading Codecov reports
1 parent f267b98 commit 54ca812

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Use Node.js 20.x
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run tests with coverage
27+
run: npm test -- --coverage
28+
29+
- name: Upload coverage to Codecov
30+
uses: codecov/codecov-action@v4
31+
with:
32+
files: ./coverage/lcov.info
33+
flags: unittests
34+
fail_ci_if_error: true
35+
env:
36+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)