-
Notifications
You must be signed in to change notification settings - Fork 498
87 lines (77 loc) · 2.5 KB
/
cypress.yaml
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
name: Cypress Tests
on:
schedule:
- cron: "30 22 * * *"
pull_request:
branches:
- develop
- master
workflow_dispatch:
jobs:
cypress-run:
permissions: write-all
if: github.repository == 'coronasafe/care_fe'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- name: Checkout 📥
uses: actions/checkout@v3
- name: Checkout care 📥
uses: actions/checkout@v3
with:
repository: coronasafe/care
path: care
- name: Start care docker containers 🐳
run: |
cd care
make docker_config_file=docker-compose.pre-built.yaml up
while docker compose exec celery-beat bash -c "python manage.py showmigrations 2>/dev/null | cat | grep -q '\[ \]'"; do
>&2 echo "Migrations are not yet applied - sleeping"
sleep 10
done
echo "Migrations are applied"
cd ..
- name: Load dummy data into care backend 📂
run: |
cd care
docker compose exec backend bash -c "python manage.py load_dummy_data"
docker restart care-backend-1
cd ..
- name: Wait for care to be up ♻
uses: nick-fields/retry@v2
with:
timeout_minutes: 1
max_attempts: 5
command: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:9000
on_retry_command: sleep 5
- name: Install dependencies 📦
run: npm install
- name: Build & Compile rescript files ⚙️
run: "npm run build"
- name: Cypress run 🥬
uses: cypress-io/github-action@v5
with:
env: SKIP_PREFLIGHT_CHECK=true
install: false
start: "npx vite preview --host"
wait-on: "http://localhost:4000"
wait-on-timeout: 300
browser: chrome
record: true
parallel: true
env:
CARE_API: http://localhost:9000
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max_old_space_size=4096
COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}}
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}
- name: Upload cypress screenshots on failure 📸
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots