File tree Expand file tree Collapse file tree 1 file changed +37
-14
lines changed
Expand file tree Collapse file tree 1 file changed +37
-14
lines changed Original file line number Diff line number Diff line change 11# .github/workflows/ci.yml
2- name : CI
2+ name : Node.js CI
33
44on :
55 push :
66 branches : [main]
77 pull_request :
88 branches : [main]
99
10+ permissions :
11+ contents : read
12+
1013jobs :
1114 build :
15+ name : CI
1216 runs-on : ubuntu-latest
13-
17+ strategy :
18+ matrix :
19+ node-version : ["20"]
1420 steps :
1521 - name : Checkout code
16- uses : actions/checkout@v5
17-
18- # Add your build, test, or deployment steps here
19- # Example for Node.js projects:
20- # - name: Set up Node.js
21- # uses: actions/setup-node@v4
22- # with:
23- # node-version: '20'
24- # - name: Install dependencies
25- # run: npm install
26- # - name: Run tests
27- # run: npm test
22+ uses : actions/checkout@v4
23+
24+ - name : Set up Node.js ${{ matrix.node-version }}
25+ uses : actions/setup-node@v4
26+ with :
27+ node-version : ${{ matrix.node-version }}
28+ cache : " npm"
29+
30+ - name : Install dependencies
31+ run : npm ci
32+
33+ - name : Lint
34+ run : npm run lint --if-present
35+
36+ - name : Run tests
37+ run : npm test --if-present
38+
39+ - name : Run npm audit (informational)
40+ run : npm audit --audit-level=high || true
41+
42+ - name : Upload test/coverage artifact
43+ if : always()
44+ uses : actions/upload-artifact@v4
45+ with :
46+ name : test-artifacts
47+ path : |
48+ coverage
49+ jest-results.xml
50+ test-results
You can’t perform that action at this time.
0 commit comments