-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.16 KB
/
main.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
46
47
name: Tests
on:
workflow_dispatch:
push:
branches: [ "dev", "main" ]
pull_request:
branches: [ "dev", "main" ]
jobs:
build:
runs-on: ubuntu-latest
env:
NODE_ENV: ${{ vars.NODE_ENV }}
KEY: ${{ secrets.KEY }}
USER_TEST: ${{ secrets.USER_TEST }}
MAPBOX: ${{ secrets.MAPBOX }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
- run: echo "NODE_ENV = $NODE_ENV"
- run: npm ci
- run: npm run build --if-present
- name: Start server
run: |
sudo NODE_ENV=$NODE_ENV KEY=$KEY USER_TEST=$USER_TEST MAPBOX=$MAPBOX npm start &
sleep 16 # Give server some time to start
- name: Check if server is running
run: |
curl --fail http://localhost:80 || exit 1
- name: Run app tests
run: npm run test:app
- name: Run login tests
run: npm run test:login
- name: Run unit tests
run: npm run test:unit
- run: echo "--- base tests complete ---"
- name: Run integration tests
run: npm run test:integration