-
Notifications
You must be signed in to change notification settings - Fork 10
94 lines (87 loc) · 2.85 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
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
name: pytest
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
debian-version: [ "11", "12" ]
sqlalchemy-version: [ "1.4" ]
include:
- debian-version: "11"
python-version: "3.9"
postgres-version: "13"
postgis-version: "3.2"
- debian-version: "12"
python-version: "3.11"
postgres-version: "15"
postgis-version: "3.3"
name: Debian ${{ matrix.debian-version }} - SQLAlchemy ${{ matrix.sqlalchemy-version }}
services:
postgres:
image: postgis/postgis:${{ matrix.postgres-version }}-${{ matrix.postgis-version }}
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Add database extensions
run: |
psql -h localhost -U postgres -d postgres -tc 'CREATE EXTENSION "postgis_raster";'
psql -h localhost -U postgres -d postgres -tc 'CREATE EXTENSION "uuid-ossp";'
psql -h localhost -U postgres -d postgres -tc 'CREATE EXTENSION "pg_trgm";'
psql -h localhost -U postgres -d postgres -tc 'CREATE EXTENSION "unaccent";'
env:
PGPASSWORD: postgres
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install \
pytest-cov \
-e .[tests] \
-e file:dependencies/Utils-Flask-SQLAlchemy#egg=utils-flask-sqlalchemy \
-e file:dependencies/TaxHub#egg=taxhub \
-e file:dependencies/UsersHub-authentification-module#egg=pypnusershub
- name: Install database
run: |
flask db upgrade taxonomie@head -x local-srid=2154
flask db upgrade ref_geo@head -x local-srid=2154
flask db upgrade nomenclatures_taxonomie@head
flask db autoupgrade
flask taxref import-v15 --skip-bdc-statuts
flask db upgrade nomenclatures_taxonomie_data@head
env:
NOMENCLATURE_SETTINGS: test_settings.py
- name: Test with pytest
run: |
pytest -v --cov --cov-report xml
env:
NOMENCLATURE_SETTINGS: test_settings.py
- name: Upload coverage to Codecov
if: ${{ matrix.debian-version == '12' && matrix.sqlalchemy-version == '1.4' }}
uses: codecov/codecov-action@v3
with:
flags: pytest