-
Notifications
You must be signed in to change notification settings - Fork 9
52 lines (51 loc) · 1.63 KB
/
pytest.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
name: Unit Tests
on: [push]
jobs:
Pytest_bootstrapper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pipenv'
- run: pipenv install --dev --deploy
- name: Test with pytest
run: pipenv run pytest
Pytest:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpass
POSTGRES_DB: my_project_test_db
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
fe_type: [react, vue]
steps:
- uses: actions/checkout@v4
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pipenv'
- name: Install bootstrapper dependencies
run: pipenv install --dev --deploy
- run: |
config_file="cookiecutter/${{ matrix.fe_type }}_template.yaml"
pipenv run cookiecutter . --config-file $config_file --no-input -f
- name: Pytest, McCabe, and Coverage
run: |
cd my_project
pipenv install --dev --deploy
mkdir -p client/dist/static
pipenv run python server/manage.py collectstatic
pipenv run pytest --mccabe --cov=my_project -vv server/my_project
pipenv run coverage report --fail-under=20