-
-
Notifications
You must be signed in to change notification settings - Fork 24
117 lines (99 loc) · 2.88 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
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
106
107
108
109
110
111
112
113
114
115
116
117
# This is a basic workflow to help you get started with Actions
name: Cypress
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [master]
pull_request:
branches: [master]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
cache: 'pip'
- name: Cypress install
uses: cypress-io/github-action@v4
with:
runTests: false
- name: Install dependencies
run: |
make clean
make requirements
pip install -U -r sandbox/requirements.txt
- name: Prepare database
run: |
sandbox/manage.py migrate
sandbox/manage.py loaddata sandbox/exampledata/users.json
sandbox/manage.py loaddata sandbox/exampledata/cms.json
sandbox/manage.py loaddata sandbox/exampledata/default_tags.json
- uses: actions/upload-artifact@v3
with:
name: database
path: db.sqlite3
run:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
browser:
- chrome
- firefox
spec:
- cypress/e2e/admin.js
- cypress/e2e/cookie_bar.js
- cypress/e2e/cookie_consent.js
- cypress/e2e/home_page.js
- cypress/e2e/manage_page.js
- cypress/e2e/sandbox.js
- cypress/e2e/tags.js
- cypress/e2e/triggers.js
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
cache: 'pip'
- name: Install dependencies
run: |
make clean
make requirements
pip install -U -r sandbox/requirements.txt
- uses: actions/download-artifact@v3
with:
name: database
- name: Cypress run
uses: cypress-io/github-action@v4
with:
install: false
start: make run_test_sandbox
wait-on: "http://localhost:8000"
record: false
browser: ${{ matrix.browser }}
spec: ${{ matrix.spec }}
env:
ENVIRONMENT: test
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
# Kills the sandbox
- name: Kill sandbox
run: kill $(jobs -p) || true
- uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos
path: cypress/videos