Skip to content

Commit 496398e

Browse files
committed
feat: adding github action for the unit tests
1 parent bb135da commit 496398e

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI - Unit Tests
2+
3+
on:
4+
push:
5+
branches: ['master'] # or your master branch
6+
pull_request:
7+
branches: ['master'] # or whichever branches you want to test on PR
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
# 1) Check out your repository code
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
# 2) Use a Node version (e.g., 16, 18, or LTS)
19+
- name: Use Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 16
23+
24+
# 3) Install dependencies
25+
- name: Install dependencies
26+
run: npm install
27+
28+
# 4) (Optional) Build step if your project requires a build
29+
# - e.g. "npm run build"
30+
# run: npm run build
31+
32+
# 5) Run unit tests
33+
- name: Run tests
34+
run: npm test
35+
36+
# 6) (Optional) Upload coverage folder as an artifact
37+
- name: Upload coverage artifact
38+
if: always()
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: coverage
42+
path: coverage

0 commit comments

Comments
 (0)