-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 1.44 KB
/
tests.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
name: Tests
env:
CI: "1"
on:
push:
branches:
- main
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Python Poetry Action
uses: abatilo/[email protected]
with:
poetry-version: 1.8.2
- uses: actions/setup-python@v4
with:
python-version: '3.10.10'
cache: 'poetry'
- name: Install deps
run: |
poetry install
- name: Unit Tests
run: poetry run python ./manage.py test
- name: Test w/ Production Dump
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
PRODUCTION_DATABASE_URL: ${{ secrets.PRODUCTION_DATABASE_URL }}
run: |
poetry run python development.py database clone --remote-db-envvar PRODUCTION_DATABASE_URL
poetry run ./manage.py migrate
poetry run ./manage.py set_user_password [email protected] test
poetry run ./manage.py runserver &
npm install
npm run cy:test