File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments