|
1 | 1 | name: CI/CD
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| -push: |
5 |
| -branches: |
6 |
| -- "master" |
7 |
| -tags: |
8 |
| -- "*" |
9 |
| -pull_request: |
10 |
| -branches: |
11 |
| -- "*" |
12 |
| -schedule: |
13 |
| -# Run weekly on Saturday |
14 |
| -- cron: "37 3 * * SAT" |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "master" |
| 7 | + tags: |
| 8 | + - "*" |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - "*" |
| 12 | + schedule: |
| 13 | + # Run weekly on Saturday |
| 14 | + - cron: "37 3 * * SAT" |
15 | 15 |
|
16 | 16 | jobs:
|
17 |
| -lint: |
18 |
| -name: Run the linters |
19 |
| -runs-on: ubuntu-latest |
20 |
| -strategy: |
21 |
| -fail-fast: false |
22 |
| -matrix: |
23 |
| -python-version: ["3.12"] |
24 |
| - |
25 |
| -steps: |
26 |
| - |
27 |
| - |
28 |
| -- name: Set up Python ${{ matrix.python-version }} |
29 |
| - |
30 |
| -with: |
31 |
| -python-version: ${{ matrix.python-version }} |
32 |
| - |
33 |
| -- name: Get pip cache dir |
34 |
| -id: pip-cache |
35 |
| -run: | |
36 |
| -echo "::set-output name=dir::$(pip cache dir)" |
37 |
| -- name: Cache |
38 |
| - |
39 |
| -with: |
40 |
| -path: ${{ steps.pip-cache.outputs.dir }} |
41 |
| -key: ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }} |
42 |
| -restore-keys: | |
43 |
| -${{ matrix.python-version }}-v1- |
44 |
| -- name: Install dependencies |
45 |
| -run: | |
46 |
| -python -m pip install --upgrade pip |
47 |
| -python -m pip install --upgrade tox |
48 |
| -- name: Test with tox |
49 |
| -run: | |
50 |
| -tox -e lint |
51 |
| -tox -e manifest |
52 |
| -tox -e changelog -- --draft |
53 |
| -tox -e docs |
54 |
| -tox -e pypi-description |
55 |
| - |
56 |
| -test: |
57 |
| -name: Run the test suite |
58 |
| -runs-on: ubuntu-latest |
59 |
| -strategy: |
60 |
| -fail-fast: false |
61 |
| -max-parallel: 5 |
62 |
| -matrix: |
63 |
| -python-version: ["3.11", "3.12", "3.13"] |
64 |
| - |
65 |
| -steps: |
66 |
| - |
67 |
| - |
68 |
| -- name: Set up Python ${{ matrix.python-version }} |
69 |
| - |
70 |
| -with: |
71 |
| -python-version: ${{ matrix.python-version }} |
72 |
| - |
73 |
| -- name: Get pip cache dir |
74 |
| -id: pip-cache |
75 |
| -run: | |
76 |
| -echo "::set-output name=dir::$(pip cache dir)" |
77 |
| - |
78 |
| -- name: Cache |
79 |
| - |
80 |
| -with: |
81 |
| -path: ${{ steps.pip-cache.outputs.dir }} |
82 |
| -key: ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }} |
83 |
| -restore-keys: | |
84 |
| -${{ matrix.python-version }}-v1- |
85 |
| - |
86 |
| -- name: Install dependencies |
87 |
| -run: | |
88 |
| -python -m pip install --upgrade pip |
89 |
| -python -m pip install -e .[test] |
90 |
| - |
91 |
| -- name: Install GDAL |
92 |
| -run: | |
93 |
| -sudo add-apt-repository ppa:ubuntugis/ppa |
94 |
| -sudo apt-get update |
95 |
| -sudo apt-get install gdal-bin libgdal-dev |
96 |
| -read GDAL_VERSION <<< $(gdal-config --version) |
| 17 | + lint: |
| 18 | + name: Run the linters |
| 19 | + runs-on: ubuntu-latest |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + python-version: ["3.12"] |
| 24 | + |
| 25 | + steps: |
| 26 | + |
| 27 | + |
| 28 | + - name: Set up Python ${{ matrix.python-version }} |
| 29 | + |
| 30 | + with: |
| 31 | + python-version: ${{ matrix.python-version }} |
| 32 | + |
| 33 | + - name: Get pip cache dir |
| 34 | + id: pip-cache |
| 35 | + run: | |
| 36 | + echo "::set-output name=dir::$(pip cache dir)" |
| 37 | + - name: Cache |
| 38 | + |
| 39 | + with: |
| 40 | + path: ${{ steps.pip-cache.outputs.dir }} |
| 41 | + key: ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }} |
| 42 | + restore-keys: | |
| 43 | + ${{ matrix.python-version }}-v1- |
| 44 | + - name: Install dependencies |
| 45 | + run: | |
| 46 | + python -m pip install --upgrade pip |
| 47 | + python -m pip install --upgrade tox |
| 48 | + - name: Test with tox |
| 49 | + run: | |
| 50 | + tox -e lint |
| 51 | + tox -e manifest |
| 52 | + tox -e changelog -- --draft |
| 53 | + tox -e docs |
| 54 | + tox -e pypi-description |
| 55 | +
|
| 56 | + test: |
| 57 | + name: Run the test suite |
| 58 | + runs-on: ubuntu-latest |
| 59 | + strategy: |
| 60 | + fail-fast: false |
| 61 | + max-parallel: 5 |
| 62 | + matrix: |
| 63 | + python-version: ["3.11", "3.12", "3.13"] |
| 64 | + |
| 65 | + steps: |
| 66 | + |
| 67 | + |
| 68 | + - name: Set up Python ${{ matrix.python-version }} |
| 69 | + |
| 70 | + with: |
| 71 | + python-version: ${{ matrix.python-version }} |
| 72 | + |
| 73 | + - name: Get pip cache dir |
| 74 | + id: pip-cache |
| 75 | + run: | |
| 76 | + echo "::set-output name=dir::$(pip cache dir)" |
| 77 | +
|
| 78 | + - name: Cache |
| 79 | + |
| 80 | + with: |
| 81 | + path: ${{ steps.pip-cache.outputs.dir }} |
| 82 | + key: ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }} |
| 83 | + restore-keys: | |
| 84 | + ${{ matrix.python-version }}-v1- |
| 85 | +
|
| 86 | + - name: Install dependencies |
| 87 | + run: | |
| 88 | + python -m pip install --upgrade pip |
| 89 | + python -m pip install -e .[test] |
| 90 | +
|
| 91 | + - name: Install GDAL |
| 92 | + run: | |
| 93 | + sudo add-apt-repository ppa:ubuntugis/ppa |
| 94 | + sudo apt-get update |
| 95 | + sudo apt-get install gdal-bin libgdal-dev |
| 96 | + read GDAL_VERSION <<< $(gdal-config --version) |
97 | 97 | echo $GDAL_VERSION
|
98 | 98 | python -m pip install GDAL==$GDAL_VERSION
|
99 | 99 |
|
@@ -184,56 +184,56 @@ read GDAL_VERSION <<< $(gdal-config --version)
|
184 | 184 | id: pip-cache
|
185 | 185 | run: echo "dir::$(pip cache dir)" >> $GITHUB_OUTPUT
|
186 | 186 |
|
187 |
| - - name: Cache |
188 |
| - |
189 |
| - with: |
190 |
| - path: ${{ steps.pip-cache.outputs.dir }} |
191 |
| - key: ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }} |
192 |
| - restore-keys: | |
193 |
| - ${{ matrix.python-version }}-v1- |
| 187 | + - name: Cache |
| 188 | + |
| 189 | + with: |
| 190 | + path: ${{ steps.pip-cache.outputs.dir }} |
| 191 | + key: ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }} |
| 192 | + restore-keys: | |
| 193 | + ${{ matrix.python-version }}-v1- |
194 | 194 |
|
195 |
| - - name: Install dependencies |
196 |
| - run: | |
197 |
| - python -m pip install --upgrade pip |
198 |
| - python -m pip install --upgrade tox |
| 195 | + - name: Install dependencies |
| 196 | + run: | |
| 197 | + python -m pip install --upgrade pip |
| 198 | + python -m pip install --upgrade tox |
199 | 199 |
|
200 |
| - - name: Build a binary wheel and a source tarball |
201 |
| - run: tox -e build |
| 200 | + - name: Build a binary wheel and a source tarball |
| 201 | + run: tox -e build |
202 | 202 |
|
203 |
| - - name: Upload distributions |
204 |
| - |
205 |
| - with: |
206 |
| - name: dist |
207 |
| - path: "dist/*" |
| 203 | + - name: Upload distributions |
| 204 | + |
| 205 | + with: |
| 206 | + name: dist |
| 207 | + path: "dist/*" |
208 | 208 |
|
209 | 209 | publish:
|
210 |
| - name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI |
211 |
| - if: startsWith(github.ref, 'refs/tags') |
212 |
| - needs: [build] |
213 |
| - runs-on: ubuntu-latest |
214 |
| - steps: |
215 |
| - |
216 |
| - - name: Download distributions |
217 |
| - |
218 |
| - with: |
219 |
| - name: dist |
220 |
| - path: dist/ |
221 |
| - |
222 |
| - - name: Publish distribution 📦 to Test PyPI |
223 |
| - |
224 |
| - with: |
225 |
| - password: ${{ secrets.TEST_PYPI_API_TOKEN }} |
226 |
| - repository_url: https://test.pypi.org/legacy/ |
227 |
| - verify_metadata: false |
228 |
| - skip_existing: true |
229 |
| - verbose: true |
230 |
| - print_hash: true |
231 |
| - |
232 |
| - - name: Publish distribution 📦 to PyPI |
233 |
| - if: startsWith(github.ref, 'refs/tags') |
234 |
| - |
235 |
| - with: |
236 |
| - password: ${{ secrets.PYPI_API_TOKEN }} |
237 |
| - verify_metadata: false |
238 |
| - verbose: true |
239 |
| - print_hash: true |
| 210 | + name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI |
| 211 | + if: startsWith(github.ref, 'refs/tags') |
| 212 | + needs: [build] |
| 213 | + runs-on: ubuntu-latest |
| 214 | + steps: |
| 215 | + |
| 216 | + - name: Download distributions |
| 217 | + |
| 218 | + with: |
| 219 | + name: dist |
| 220 | + path: dist/ |
| 221 | + |
| 222 | + - name: Publish distribution 📦 to Test PyPI |
| 223 | + |
| 224 | + with: |
| 225 | + password: ${{ secrets.TEST_PYPI_API_TOKEN }} |
| 226 | + repository_url: https://test.pypi.org/legacy/ |
| 227 | + verify_metadata: false |
| 228 | + skip_existing: true |
| 229 | + verbose: true |
| 230 | + print_hash: true |
| 231 | + |
| 232 | + - name: Publish distribution 📦 to PyPI |
| 233 | + if: startsWith(github.ref, 'refs/tags') |
| 234 | + |
| 235 | + with: |
| 236 | + password: ${{ secrets.PYPI_API_TOKEN }} |
| 237 | + verify_metadata: false |
| 238 | + verbose: true |
| 239 | + print_hash: true |
0 commit comments