-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 1.27 KB
/
tests.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
48
49
name: Run automated tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: caramela_test
POSTGRES_PASSWORD: docker
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Create .env
run: |
touch .env
echo DATABASE_URL="postgres://postgres:docker@localhost:5432/caramela_test" >> .env
echo JWT_SECRET="Git#Hub1Actions2Secret3" >> .env
echo REFRESH_TOKEN_SECRET="Git#Hub1Actions2Refresh3Secret4" >> .env
cat .env
- run: yarn
- run: yarn build
- run: yarn test:all