-
-
Notifications
You must be signed in to change notification settings - Fork 314
162 lines (158 loc) · 5.43 KB
/
main.yml
File metadata and controls
162 lines (158 loc) · 5.43 KB
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
151
152
153
154
155
156
157
158
159
160
161
162
name: Build
on:
push:
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
branches:
- master
paths-ignore:
- '!**.md'
- 'docs/**'
release:
types:
- released
jobs:
main:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- python-version: '3.12'
env:
PYGEOAPI_CONFIG: "$(pwd)/pygeoapi-config.yml"
DOCKER_API_VERSION: "1.44"
services:
postgres:
image: postgis/postgis:14-3.2
ports:
- 5432:5432
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: ${{ secrets.DatabasePassword || 'postgres' }}
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_DATABASE: test_geo_app
MYSQL_USER: pygeoapi
MYSQL_PASSWORD: mysql
ports:
- 3306:3306
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.17.0
ports:
- 9200:9200
- 9300:9300
env:
discovery.type: single-node
xpack.security.enabled: "false"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
opensearch:
image: opensearchproject/opensearch:2.18.0
ports:
- 9209:9200
env:
discovery.type: single-node
DISABLE_SECURITY_PLUGIN: "true"
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
mongodb:
image: mongo:8.0.4
ports:
- 27017:27017
sensorthings:
image: ghcr.io/cgs-earth/sensorthings-action:0.1.2
volumes:
- /var/run/docker.sock:/var/run/docker.sock
steps:
- name: Clear up GitHub runner diskspace
run: |
echo "Space before"
df -h /
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
echo "Space after"
df -h /
- name: Chown user
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- uses: actions/checkout@master
- uses: actions/setup-python@v5
name: Setup Python ${{ matrix.python-version }}
with:
python-version: ${{ matrix.python-version }}
- name: Install and run Oracle
run: |
docker run \
-d \
--name oracledb \
-e ORACLE_PWD=oracle \
-v ${{ github.workspace }}/tests/data/oracle/init-db:/opt/oracle/scripts/startup \
-p 1521:1521 \
container-registry.oracle.com/database/express:21.3.0-xe
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Install sqlite and gpkg dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.4.3
with:
packages: libsqlite3-mod-spatialite
version: 4.3.0a-6build1
- name: Use ubuntuGIS unstable ppa
run: |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt-get install gdal-bin libgdal-dev -y
shell: bash
# - name: Install GDAL with Python bindings
# uses: awalsh128/cache-apt-pkgs-action@v1.4.3
# with:
# packages: gdal-bin libgdal-dev
# version: 3.11.3
- name: Install requirements 📦
run: |
pip3 install setuptools
pip3 install -r requirements.txt
pip3 install -r requirements-admin.txt
pip3 install -r requirements-starlette.txt
pip3 install -r requirements-dev.txt
pip3 install -r requirements-provider.txt
pip3 install -r requirements-manager.txt
pip3 install -r requirements-django.txt
pip3 install -r requirements-pubsub.txt
pip3 install .
pip3 install GDAL==`gdal-config --version`
- name: setup test data ⚙️
run: |
python3 tests/load_oracle_data.py
python3 tests/load_es_data.py tests/data/ne_110m_populated_places_simple.geojson geonameid
python3 tests/load_opensearch_data.py tests/data/ne_110m_populated_places_simple.geojson geonameid
python3 tests/load_mongo_data.py tests/data/ne_110m_populated_places_simple.geojson
gunzip < tests/data/hotosm_bdi_waterways.sql.gz | psql postgresql://postgres:${{ secrets.DatabasePassword || 'postgres' }}@localhost:5432/test
psql postgresql://postgres:${{ secrets.DatabasePassword || 'postgres' }}@localhost:5432/test -f tests/data/dummy_data.sql
psql postgresql://postgres:${{ secrets.DatabasePassword || 'postgres' }}@localhost:5432/test -f tests/data/dummy_types_data.sql
psql postgresql://postgres:${{ secrets.DatabasePassword || 'postgres' }}@localhost:5432/test -f tests/data/postgres_manager_full_structure.backup.sql
mysql -h 127.0.0.1 -P 3306 -u root -p'mysql' test_geo_app < tests/data/mysql_data.sql
docker ps
- name: run API tests ⚙️
run: pytest tests/api --ignore-glob='*_live.py'
- name: run Formatter tests ⚙️
run: pytest tests/formatter
- name: run Provider tests ⚙️
env:
POSTGRESQL_PASSWORD: ${{ secrets.DatabasePassword || 'postgres' }}
run: pytest tests/provider --ignore-glob='*_live.py'
- name: run Manager tests ⚙️
env:
POSTGRESQL_PASSWORD: ${{ secrets.DatabasePassword || 'postgres' }}
run: pytest tests/manager
- name: run other tests ⚙️
run: pytest tests/other --ignore-glob='*_live.py'
- name: failed tests 🚩
if: ${{ failure() }}
run: |
pip3 list -v