-
Notifications
You must be signed in to change notification settings - Fork 57
142 lines (123 loc) · 5.1 KB
/
Copy pathpackages.yml
File metadata and controls
142 lines (123 loc) · 5.1 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
name: "📦 Workspace packages"
# Stage 2 of ROADMAP.md (outcome 2): loop_common/loop_interpolation live under
# packages/ as independent uv-workspace members so the interpolation code is
# usable outside the LoopStructural framework. Stage 4 (outcomes 5, 7) added
# loopstructural_visualisation (packages-test matrix, below) and map2loop
# (map2loop-test, its own job: map2loop hard-depends on GDAL bindings, which
# aren't pip-installable on Windows/macOS the way this matrix installs
# everything else, so it only runs on ubuntu with an apt-installed libgdal —
# matching map2loop's own upstream CI, which uses conda for the same reason).
# This job installs and tests packages on their own, separately from the root
# LoopStructural test suite in tester.yml. loopstructural-test waits on both
# jobs (needs:) so the root suite only runs once every workspace package is
# confirmed working.
on:
push:
branches:
- master
paths:
- 'packages/**'
- .github/workflows/packages.yml
pull_request:
branches:
- master
paths:
- 'packages/**'
- .github/workflows/packages.yml
workflow_dispatch:
permissions:
contents: read
jobs:
packages-test:
# matrix.package.name is the uv/PyPI package name (as declared in each
# package's pyproject.toml `[project] name`); matrix.package.dir is its
# directory under packages/. These differ for loopstructuralvisualisation:
# its published/import name has no separator, but its directory uses an
# underscore, and `uv --package` matches on the declared name (with only
# hyphen/underscore treated as equivalent, not a missing separator).
name: ${{ matrix.package.name }} (python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
package:
- { name: loop_common, dir: loop_common }
- { name: loop_interpolation, dir: loop_interpolation }
- { name: loopstructuralvisualisation, dir: loopstructural_visualisation }
os: ${{ fromJSON(vars.BUILD_OS)}}
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install package with test extras
run: |
uv sync --package ${{ matrix.package.name }} --extra tests --python ${{ matrix.python-version }}
- name: pytest
run: |
uv run --package ${{ matrix.package.name }} pytest packages/${{ matrix.package.dir }}/tests
map2loop-test:
# Separate job (not part of the packages-test matrix above): map2loop
# imports osgeo/gdal at module load time, which has no pip-installable
# wheel on Windows/macOS (confirmed: building GDAL from the PyPI sdist
# fails without system libgdal headers). Scoped to ubuntu-latest only,
# installing libgdal via apt, mirroring how map2loop's own upstream CI
# special-cases GDAL per-OS (it uses conda-forge everywhere). Revisit
# widening the OS matrix if/when a reliable cross-platform GDAL install
# path is found.
name: map2loop (python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS) }}
steps:
- uses: actions/checkout@v4
- name: Install GDAL system libraries
run: |
sudo apt-get update
sudo apt-get install -y gdal-bin libgdal-dev
echo "CPLUS_INCLUDE_PATH=/usr/include/gdal" >> "$GITHUB_ENV"
echo "C_INCLUDE_PATH=/usr/include/gdal" >> "$GITHUB_ENV"
- name: Set up uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install package with test extras
run: |
uv sync --package map2loop --extra tests --python ${{ matrix.python-version }}
GDAL_VERSION=$(gdal-config --version)
uv pip install setuptools
uv pip install "gdal==${GDAL_VERSION}" --no-build-isolation-package gdal
- name: pytest
run: |
uv run --package map2loop pytest packages/map2loop/tests
loopstructural-test:
name: LoopStructural (python ${{ matrix.python-version }})
needs: [packages-test, map2loop-test]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(vars.BUILD_OS)}}
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install package with test extras
run: |
uv sync --extra tests --python ${{ matrix.python-version }}
- name: pytest
run: |
uv run pytest tests