-
-
Notifications
You must be signed in to change notification settings - Fork 324
64 lines (60 loc) · 1.93 KB
/
pr-master-api-e2e.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: API E2E Testing
on:
push:
branches:
- master
pull_request:
jobs:
# Label of the container job
container-job:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
# container: node:20
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
image: postgres:13
env:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
POSTGRES_DB: tests
ports:
- 5434: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:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v3
- name: Use Node.js ${{ env.NODE_VERSION }} on ${{ matrix.os }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: restore lerna
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile --network-timeout 1000000
- name: Build apps (with retries)
uses: nick-invision/retry@v2
with:
timeout_minutes: 15
max_attempts: 3
command: yarn build:ci
# - name: Update env file
# run: |
# echo DATABASE_URL="postgresql://prisma:prisma@postgres:5434/tests?schema=public" >> packages/altair-api/.env.e2e
# cat packages/altair-api/.env.e2e
- name: Migration
run: yarn --cwd packages/altair-api migrate:e2e
- name: Run E2E
run: yarn --cwd packages/altair-api test:e2e