-
-
Notifications
You must be signed in to change notification settings - Fork 221
69 lines (63 loc) · 2 KB
/
cypress.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
65
66
67
68
69
name: End-to-end tests
on: [pull_request]
jobs:
cypress-run:
runs-on: ubuntu-latest
env:
CYPRESS_ROOT_URL: http://localhost:5678
CI: true
CONFIRM_DROP: 1
NODE_ENV: test
ENABLE_CYPRESS_COMMANDS: 1
strategy:
matrix:
node-version: [16.x]
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "0.0.0.0:5432:5432"
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install pg_dump
run: |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -yqq install postgresql-client-14
- name: Setup
run: |
cp .env.ci .env
yarn --immutable
yarn setup
yarn build
- name: Start server in background
run: yarn server start &
- name: Start worker in background
run: yarn worker start &
- name: Cypress run
uses: cypress-io/github-action@v5
with:
wait-on: http://localhost:5678
working-directory: "@app/e2e"
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: "@app/e2e/cypress/screenshots"
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
path: "@app/e2e/cypress/videos"