-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (64 loc) · 2.16 KB
/
Copy pathmain.yml
File metadata and controls
70 lines (64 loc) · 2.16 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
name: test plugins ⚙️
on: [push, pull_request]
env:
POSTGRESQL_PASSWORD: ${{ secrets.DatabasePassword || 'postgres' }}
jobs:
main:
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:14-3.2
ports:
- 5432:5432
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: ${{ secrets.DatabasePassword || 'postgres' }}
redis:
image: redis:latest
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Setup Python
with:
python-version: 3.12
- name: Start pygeoapi sitemap instance
run: |
docker compose up -d --build &
- 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
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: 'uv.lock'
- name: Install the project
run: |
uv sync --inexact --all-packages --extra dev
uv pip install GDAL==`gdal-config --version`
- name: Setup test data ⚙️
run: |
gunzip < tests/data/hotosm_bdi_waterways.sql.gz | psql postgresql://postgres:${{ env.POSTGRESQL_PASSWORD }}@localhost:5432/test
- name: Run unit tests ⚙️
env:
POSTGRESQL_PASSWORD: ${{ env.POSTGRESQL_PASSWORD }}
run: |
uv run pytest tests/test_intersect_process.py
uv run pytest tests/test_geopandas_provider.py
uv run pytest tests/test_jsonfg_formatter.py
uv run pytest tests/test_postgresql_provider.py
uv run pytest tests/test_mvt_postgresql_provider.py
uv run pytest tests/test_sitemap_process.py
uv run pytest tests/test_sparql_provider.py
uv run pytest tests/test_xml_formatter.py
- name: Failed Tests
if: failure()
run: |
echo "Tests failed. Collecting logs..."
docker ps -a
docker logs pygeoapi-plugins-pygeoapi-1
uv pip freeze