-
Notifications
You must be signed in to change notification settings - Fork 23
139 lines (132 loc) · 4.42 KB
/
ci.yaml
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
name: CI
on: [push]
jobs:
lint:
name: Check style (lint)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- run: sudo rm /etc/apt/sources.list.d/*.list
- run: sudo apt update
- run: sudo apt-get install libpq-dev
- name: Run make lint
run: make lint
gitattributes:
name: Check style (git-attributes)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- run: sudo rm /etc/apt/sources.list.d/*.list
- run: sudo apt update
- run: sudo apt-get install libpq-dev
- name: Run make git-attributes
run: make git-attributes
test-py:
name: Test Python
runs-on: ubuntu-22.04
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgis/postgis
# Provide the password for postgres
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up Python v${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: sudo rm /etc/apt/sources.list.d/*.list
- run: sudo apt update
- run: sudo apt-get install libpq-dev
- name: Run tests for Python ${{ matrix.python-version }}
run: make tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.core.xml,./coverage.contrib-data_sources-standard.xml,./coverage.contrib-data_sources-interlis.xml,./coverage.contrib-print_proxy-mapfish_print.xml,./coverage.contrib-stats.xml
flags: unittests
name: codecov-unittest
verbose: true
test-fed-data:
name: Check federal data definitions
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- run: sudo rm /etc/apt/sources.list.d/*.list
- run: sudo apt update
- run: sudo apt-get install xsltproc
- name: Check updates of federal data
run: >
(make check_fed_data
&& echo "::Notice ::The federal data definitions seem to be up to date.")
|| (exit_code=$?;
echo "::warning ::The federal data definitions seem to be out of date. Check fed.urls if the links are still valid. You may use the tools 'make update_fed_data_urls' and 'make auto_update_fed_data'.";
exit $exit_code)
doc:
name: Make and deploy documentation
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Make documentation
run: |
sudo rm /etc/apt/sources.list.d/*.list
sudo apt update
sudo apt-get install libpq-dev
make doc-html
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.6.3
with:
branch: gh-pages # The branch the action should deploy to.
folder: doc/build/html # The folder the action should deploy.
build-and-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-22.04
needs: [lint, gitattributes]
steps:
- uses: actions/checkout@master
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}