Repository navigation
68 lines (58 loc) · 1.94 KB
/
Copy pathstack-e2e.yml
File metadata and controls
68 lines (58 loc) · 1.94 KB
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
65
66
67
68
name: Stack test the API start
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
jobs:
test:
name: Test the start of the api
# Our code will run on node 16 and Linux
strategy:
matrix:
node: [16.x]
os: [ubuntu-20.04]
runs-on: '${{ matrix.os }}'
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_DB: api
POSTGRES_PASSWORD: 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 10
steps:
# First we checkout the code
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
# We install our dependencies and generate the files
- name: Install dependencies and generate files
uses: tractr/stack/.github/actions/setup@main
with:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create .env file
run: |
echo "API_URL=http://localhost:4200/api" > .env
- name: Cypress run
uses: cypress-io/github-action@v4
with:
start: npx nx serve api
command: npx nx e2e pwa-e2e --record
record: true
install: false
wait-on: 'http://localhost:3000/api'
env:
# statement_cache_size allow the api to not throw an error when the database is truncate then seed
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/api?statement_cache_size=0
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}