-
Notifications
You must be signed in to change notification settings - Fork 1
150 lines (130 loc) · 4.29 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: pytest
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
env:
GEONATURE_CONFIG_FILE: ./dependencies/GeoNature/config/test_config.toml
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: "Debian 10"
python-version: "3.7"
postgres-version: 11
postgis-version: 2.5
- name: "Debian 11"
python-version: "3.9"
postgres-version: 13
postgis-version: 3.2
name: ${{ matrix.name }}
services:
postgres:
image: postgis/postgis:${{ matrix.postgres-version }}-${{ matrix.postgis-version }}
env:
POSTGRES_DB: geonature2db
POSTGRES_PASSWORD: geonatpasswd
POSTGRES_USER: geonatadmin
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Add postgis_raster database extension
if: ${{ matrix.postgis-version >= 3 }}
run: |
psql -h localhost -U geonatadmin -d geonature2db -tc 'CREATE EXTENSION "postgis_raster";'
env:
PGPASSWORD: geonatpasswd
- name: Add database extensions
run: |
psql -h localhost -U geonatadmin -d geonature2db -tc 'CREATE EXTENSION "hstore";'
psql -h localhost -U geonatadmin -d geonature2db -tc 'CREATE EXTENSION "uuid-ossp";'
psql -h localhost -U geonatadmin -d geonature2db -tc 'CREATE EXTENSION "pg_trgm";'
psql -h localhost -U geonatadmin -d geonature2db -tc 'CREATE EXTENSION "unaccent";'
env:
PGPASSWORD: geonatpasswd
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install GDAL
run: |
sudo apt update
sudo apt install -y libgdal-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install \
-e ..[tests] \
-r requirements-dev.txt \
working-directory: ./dependencies/GeoNature/backend
- name: Show database branches and dependencies
run: |
geonature db status --dependencies
- name: Install database
run: |
./dependencies/GeoNature/install/03b_populate_db.sh
env:
srid_local: 2154
install_bdc_statuts: true
add_sample_data: true
install_sig_layers: true
install_grid_layer_5: true
install_ref_sensitivity: true
- name: Show database status
run: |
geonature db status
- name: Install core modules
run: |
pip install -e ./dependencies/GeoNature/contrib/occtax
pip install -e ./dependencies/GeoNature/contrib/gn_module_occhab
pip install -e ./dependencies/GeoNature/contrib/gn_module_validation
- name: Install GN Modulator
run: |
pip install -e .
- name: Install modules db
run: |
geonature upgrade-modules-db
- name: check gn_modulator
run: geonature modulator check
- name: list modules
run: geonature modulator install
# - name: install m_monitoring
# run: geonature modulator install -p ./contrib/m_monitoring
# - name: install m_monitoring test 1
# run: geonature modulator install m_monitoring_test_1
# - name: install m_monitoring test 2
# run: geonature modulator install m_monitoring_test_2
- name: install m_sipaf
run: geonature modulator install -p ./contrib/m_sipaf
- name: Pytest gn_modulator
run: pytest -v --cov --cov-report xml
- name: Upload coverage to Codecov
if: ${{ matrix.name == 'Debian 11' }}
uses: codecov/codecov-action@v2
with:
flags: pytest