-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (64 loc) · 2.91 KB
/
python-ci.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
name: Python CI
on: push
jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version:
# At present, only 3.8 is supported.
- "3.8"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
# ubuntu-22.04 has the following postgres packages by default:
# postgresql-14/now 14.8-1.pgdg22.04+1 amd64 [installed,local]
# postgresql-client-14/now 14.8-1.pgdg22.04+1 amd64 [installed,local]
# postgresql-client-common/now 250.pgdg22.04+1 all [installed,local]
# postgresql-common/now 250.pgdg22.04+1 all [installed,local]
#
# postgresql-14-postgis-3 requires a different version, as installed
# below. However, the version required is periodically updated, and the
# previous version becomes unavailable. To discover what version is
# required, comment out the indicated line, read the error message, and
# update the installation as indicated.
run: |
sudo apt list --installed | grep postgres
sudo apt-get update
echo "downgrading postgresql-14"
# The version of postgresql-14 may periodically require updating. To find out what
# it must be upgraded to, comment out the following line and read the error message
# that results. For more info, see above. (This is a grim procedure.)
sudo apt-get install -yq --allow-downgrades postgresql-14=14.11-0ubuntu0.22.04.1
echo "installing postgresql-14-postgis-3"
sudo apt-get install -yq postgresql-14-postgis-3
echo "installing postgresql-plpython3-14"
sudo apt-get install -yq postgresql-plpython3-14
# Install remaining dependencies
sudo apt-get install libhdf5-serial-dev libnetcdf-dev libspatialite-dev libgdal-dev
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
# Installing this project is tricky, due to its dependency on GDAL 3.0.4.
# For an explanation, see the README.
- name: Install project
run: |
# Pre-install initial packages (pip, setuptools, numpy)
poetry install --only initial
# Install gdal using pip3 into the Poetry virtualenv
poetry run pip3 install gdal==3.0.4
# Install rest of project
poetry install --without black
- name: Test with pytest (full)
if: github.ref == 'refs/heads/master'
run: |
poetry run pytest -m "not online" -v --tb=short tests
- name: Test with pytest (fast)
if: github.ref != 'refs/heads/master'
run: |
poetry run pytest -m "not online and not slow" -v --tb=short tests