-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (45 loc) · 1.15 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Run Tests
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: '16.x'
cache: 'npm'
- name: Install dependencies
working-directory: ./backend
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi
continue-on-error: true
- name: Retry Install dependencies if it fails
if: failure()
working-directory: ./backend
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi
- name: Run Tests
working-directory: ./backend
run: npm test || echo "No tests specified" && exit 0
continue-on-error: true
- name: Retry Run Tests if it fails
if: failure()
working-directory: ./backend
run: npm test || echo "No tests specified" && exit 0