-
Notifications
You must be signed in to change notification settings - Fork 90
47 lines (44 loc) · 1.25 KB
/
tests-workflow.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:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
test_pull_request:
runs-on: ubuntu-latest
env:
APP_ENV: test
APP_PORT: 3000
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: example_db
DB_USER: root
DB_PASS: example
JWT_ACCESS_TOKEN_EXP_IN_SEC: 3600
JWT_REFRESH_TOKEN_EXP_IN_SEC: 7200
JWT_PUBLIC_KEY_BASE64: ${{ secrets.JWT_PUBLIC_KEY_BASE64 }}
JWT_PRIVATE_KEY_BASE64: ${{ secrets.JWT_PRIVATE_KEY_BASE64 }}
DEFAULT_ADMIN_USER_PASSWORD: example_admin_pass
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.14.0
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Run unit tests
run: npm test
- name: Build the docker-compose stack
run: docker-compose -f docker-compose.yml up -d pgsqldb
- name: Check running containers
run: docker ps -a
- name: Run e2e tests
run: sleep 5 && npm run test:e2e