Skip to content

[Task] #181, add token and fetching token for traffic #443

[Task] #181, add token and fetching token for traffic

[Task] #181, add token and fetching token for traffic #443

Workflow file for this run

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