-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (65 loc) · 1.8 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
name: Cypress Tests
on: pull_request
jobs:
cypress-run:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: "postgres"
ports:
- 5432:5432
steps:
# Setup code
- name: Checkout
uses: actions/checkout@v4
# Setup Python
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Set up poetry cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Setup DB
run: |
poetry run ./manage.py migrate
poetry run ./manage.py seed
# Install NPM dependencies
- name: Setup Node.js 16
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Set up npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: |
cd frontend
npm install
# Cypress RUN
- name: Cypress run
uses: cypress-io/github-action@v6
env:
CYPRESS_CI_ENV: true
with:
browser: firefox
component: true
working-directory: frontend
start: |
poetry run python ../manage.py runserver
poetry run python ../manage.py seed
npm run dev
wait-on: 'http://localhost:5173, http://localhost:8000/backend/admin'