-
Notifications
You must be signed in to change notification settings - Fork 78
105 lines (98 loc) · 3.11 KB
/
cypress_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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Run cypress happy path test
on:
workflow_dispatch:
pull_request:
types: [enqueued]
branches:
- integration
merge_group:
jobs:
cypress-tests:
name: Cypress E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres
env:
POSTGRES_DB: "pg-litefarm"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
# POSTGRES_HOST: localhost
# POSTGRES_HOST: postgres
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
volumes:
- ./initdb.d:/docker-entrypoint-initdb.d
- postgres-data:/var/lib/postgresql/data
strategy:
matrix:
node-version: [16.15.0]
env:
JWT_SECRET: This_will_(really)_work
JWT_INVITE_SECRET: Any_arbitrary_string_will_do
JWT_RESET_SECRET: Production_is_secured_with_a_long_random_string
JWT_FARM_SECRET: Here_we_can_use_friendly_explanations
JWT_SCHEDULER_SECRET: Another_token_was_needed_for_the_scheduler
GOOGLE_API_KEY: ${{secrets.VITE_GOOGLE_MAPS_API_KEY}}
VITE_GOOGLE_MAPS_API_KEY: ${{secrets.VITE_GOOGLE_MAPS_API_KEY}}
VITE_WEATHER_API_KEY: ${{secrets.VITE_WEATHER_API_KEY}}
NODE_ENV: development
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Run API in background
working-directory: packages/api
run: |
npm ci && cd ../shared && npm ci
cd ../api && npm run migrate:dev:db
npm run start &
env:
PORT: 5000
DEV_DATABASE_HOST: localhost
DEV_DATABASE: pg-litefarm
DEV_DATABASE_USER: postgres
DEV_DATABASE_PASSWORD: postgres
NODE_ENV: development
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Run Webapp
working-directory: packages/webapp
run: |
pnpm install --config.auto-install-peers=true --no-frozen-lockfile --force
pnpm dev &
env:
VITE_ENV: development
VITE_GOOGLE_OAUTH_CLIENT_ID: ${{secrets.VITE_GOOGLE_OAUTH_CLIENT_ID}}
VITE_DO_BUCKET_NAME: litefarm
NODE_ENV: development
VITE_API_URL: http://localhost:5000
CYPRESS_COVERAGE: true
- name: Run E2E test (English)
env:
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_RECORD_KEY}}
CYPRESS_USER: 0
uses: cypress-io/github-action@v6
with:
working-directory: packages/end-to-end
headed: true
browser: chrome
record: true
parallel: false
group: "UI - Chrome"
ci-build-id: ${{ github.run_id }}
- name: Archive backend logs
uses: actions/upload-artifact@v3
with:
name: logs
path: packages/api/logs