-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (62 loc) · 2.65 KB
/
Copy pathpython-ci.yml
File metadata and controls
70 lines (62 loc) · 2.65 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: Python CI
on: push
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-24.04
timeout-minutes: 15
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.python-version }}
cancel-in-progress: true
strategy:
matrix:
python-version:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install system-level dependencies
env:
PIP_INDEX_URL: https://pypi.pacificclimate.org/simple
# Ubuntu 24.04 ships with PostgreSQL 16 by default, but we target PostgreSQL 17
# to match production. Packages are sourced from the official PGDG apt repo.
# The postgis extension may require a specific version of postgresql-17;
# to find it, comment out the pin, run CI, check the output of
# `apt list --installed | grep postgres`, then add the pin back.
run: |
echo "adding PGDG apt repository"
sudo install -d /usr/share/postgresql-common/pgdg
sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail \
https://www.postgresql.org/media/keys/ACCC4CF8.asc
sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] \
https://apt.postgresql.org/pub/repos/apt noble-pgdg main" \
> /etc/apt/sources.list.d/pgdg.list'
echo "removing pre-installed postgresql-16"
sudo apt-get remove -yq 'postgresql-16*'
sudo apt list --installed 2>/dev/null | grep postgres
sudo apt-get update
echo "installing postgresql-17"
# The version of postgresql-17 may periodically require updating. See above.
sudo apt-get install -yq --allow-downgrades postgresql-17=17.10-1.pgdg24.04+1
echo "installing postgresql-17-postgis-3"
sudo apt-get install -yq postgresql-17-postgis-3=3.6.3+dfsg-1.pgdg24.04+1
echo "installing postgresql-plpython3-17"
sudo apt-get install -yq postgresql-plpython3-17=17.10-1.pgdg24.04+1
- name: Install Poetry
run: |
pip install poetry==2.4.1
- name: Install dependencies
run: |
poetry install
- name: Test with pytest
run: |
poetry run pytest -m "not online and not slow" -v tests/unit