-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 1.63 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Tests
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
jobs:
lint:
name: Flake8
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.x'
- name: Install Flake8
run: |
python3 -m pip install --upgrade pip
python3 -m pip install flake8
- name: Checkout Code
uses: actions/checkout@v4
- name: Lint Python Code
run: flake8 .
test:
name: Django Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: django
POSTGRES_PASSWORD: supersecret
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.x'
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Test Dependencies
run: |
pip install -U pip
pip install factory_boy==3.3.1 pytest==8.3.3 pytest-cov==5.0.0 \
pytest-django==4.9.0 pytest-env==1.1.5 pytest-flakes==4.0.5
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Execute Tests
env:
DJANGO_SETTINGS_MODULE: parlance.settings.testing
PARLANCE_DATABASE_URL: postgres://django:[email protected]:5432/parlance_test
PARLANCE_SECRET_KEY: supersecretsquirrel
run: pytest