Skip to content

Commit 23387d8

Browse files
authored
Adding api.yml github workflow to make for a more intricate NPM test, I will refine this. (#32)
1 parent 214aadc commit 23387d8

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/api.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Backend Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
defaults:
12+
run:
13+
working-directory: ./api
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 2
19+
20+
strategy:
21+
matrix:
22+
node-version: [20]
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Node.js with caching
29+
if: github.event_name != 'pull_request'
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
cache: 'npm'
34+
cache-dependency-path: './api/package-lock.json'
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Enforce formatting with Prettier
40+
run: npm run format
41+
42+
- name: Run ESLint
43+
run: npm run lint
44+
45+
- name: Run tests
46+
run: npm run test:ci
47+
48+
- name: Check for outdated packages
49+
run: npm outdated || echo "No outdated packages found"
50+
51+
- name: Check for security vulnerabilities
52+
run: npm audit --audit-level=high

0 commit comments

Comments
 (0)