@@ -24,49 +24,22 @@ jobs:
2424 name : " 📝 Pre-commit / Code Quality"
2525 runs-on : ubuntu-latest
2626 steps :
27- - uses : actions/checkout@v4
28- - name : ⚡ Install uv
29- run : curl -LsSf https://astral.sh/uv/install.sh | sh
27+ - uses : actions/checkout@v6
28+ - name : ⚡ Setup uv
29+ uses : astral-sh/setup-uv@v8.1.0
30+ with :
31+ enable-cache : true
32+ github-token : ${{ secrets.GITHUB_TOKEN }}
33+ cache-suffix : ${{ github.job }}
3034 - name : 🏃 Run Pre-commit
3135 run : |
3236 uv tool install pre-commit
3337 uv tool run pre-commit run --show-diff-on-failure --all-files
34-
35- setup :
36- name : " 🏗️ Build Py${{ matrix.python-version }}"
37- needs : lint
38- runs-on : ubuntu-latest
39- strategy :
40- matrix :
41- python-version : ["3.10", "3.11", "3.12", "3.13"]
42- container : ghcr.io/osgeo/gdal:ubuntu-small-latest
43- steps :
44- - uses : actions/checkout@v4
45-
46- - name : 📥 Apply Dependency Overrides
47- if : " ${{ inputs.override-deps-artifact != '' && inputs.override-deps-artifact != 'null' }}"
48- uses : actions/download-artifact@v4
49- with :
50- name : ${{ inputs.override-deps-artifact }}
51-
52- - name : ⚡ Install uv
53- run : |
54- apt-get update && apt-get install -y curl
55- curl -LsSf https://astral.sh/uv/install.sh | BINDIR=/usr/local/bin sh
56-
57- - name : 📝 Export Locked Requirements
58- run : |
59- uv export --frozen --all-extras --format requirements-txt > requirements.txt
60-
61- - name : 📤 Upload Requirements
62- uses : actions/upload-artifact@v4
63- with :
64- name : frozen-reqs-${{ matrix.python-version }}
65- path : requirements.txt
66- retention-days : 1
38+ - name : 🧹 Cache Prune
39+ run : uv cache prune --ci
6740
6841 test :
69- needs : setup
42+ needs : lint
7043 name : " 🧪 py${{ matrix.python-version }} [${{ matrix.split }}/4]"
7144 runs-on : ubuntu-latest
7245 strategy :
@@ -84,24 +57,24 @@ jobs:
8457 # Fix "Dubious Ownership" error (Required for containerized Git)
8558 git config --global --add safe.directory '*'
8659
87- - uses : actions/checkout@v4
60+ - uses : actions/checkout@v6
8861
89- - name : 📥 Download Requirements
90- uses : actions/download-artifact@v4
62+ - name : 📥 Apply Dependency Overrides
63+ if : " ${{ inputs.override-deps-artifact != '' && inputs.override-deps-artifact != 'null' }}"
64+ uses : actions/download-artifact@v8
9165 with :
92- name : frozen-reqs- ${{ matrix.python-version }}
66+ name : ${{ inputs.override-deps-artifact }}
9367
94- - name : ⚡ Install uv
95- run : |
96- curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="/usr/local/bin" sh
97-
98- uv --version
68+ - name : ⚡ Setup uv
69+ uses : astral-sh/setup-uv@v8.1.0
70+ with :
71+ enable-cache : true
72+ github-token : ${{ secrets.GITHUB_TOKEN }}
73+ cache-suffix : ${{ matrix.python-version }}-${{ matrix.split }}
9974
100- - name : 🏗️ Restore Native Env
75+ - name : 🏗️ Sync Environment
10176 run : |
102- uv venv --python ${{ matrix.python-version }}
103- uv pip install -r requirements.txt
104- uv pip install -e ".[test]" --no-deps
77+ uv sync --frozen --all-extras --python ${{ matrix.python-version }}
10578
10679 - name : 🧪 Run Tests (Split ${{ matrix.split }}/4)
10780 env :
@@ -131,7 +104,7 @@ jobs:
131104
132105 - name : 📤 Upload Coverage Chunk (Latest Only)
133106 if : matrix.python-version == '3.13'
134- uses : actions/upload-artifact@v4
107+ uses : actions/upload-artifact@v7
135108 with :
136109 name : coverage-chunk-${{ matrix.split }}
137110 path : .coverage.python.${{ matrix.python-version }}.test.split.${{ matrix.split }}
@@ -140,25 +113,32 @@ jobs:
140113
141114 - name : 📤 Archive JUnit Results
142115 if : always()
143- uses : actions/upload-artifact@v4
116+ uses : actions/upload-artifact@v7
144117 with :
145118 name : results-${{ matrix.python-version }}-${{ matrix.split }}
146119 path : pytest-${{ matrix.python-version }}-${{ matrix.split }}.xml
147120 retention-days : 1
148121
122+ - name : 🧹 Cache Prune
123+ run : uv cache prune --ci
124+
149125 summary :
150126 name : " 📊 Final Summary & Coverage"
151127 needs : test
152128 if : always()
153129 runs-on : ubuntu-latest
154130 steps :
155- - uses : actions/checkout@v4 # Needed for coverage to see source files
131+ - uses : actions/checkout@v6 # Needed for coverage to see source files
156132
157- - name : ⚡ Install uv
158- run : curl -LsSf https://astral.sh/uv/install.sh | sh
133+ - name : ⚡ Setup uv
134+ uses : astral-sh/setup-uv@v8.1.0
135+ with :
136+ enable-cache : true
137+ github-token : ${{ secrets.GITHUB_TOKEN }}
138+ cache-suffix : ${{ github.job }}
159139
160140 - name : 📥 Download Artifacts
161- uses : actions/download-artifact@v4
141+ uses : actions/download-artifact@v8
162142 with :
163143 path : all-results
164144 pattern : " *-*"
@@ -226,4 +206,4 @@ jobs:
226206 else
227207 echo "✅ **Coverage Passed:** 80% coverage achieved (Py3.13)." >> $GITHUB_STEP_SUMMARY
228208 exit 0
229- fi
209+ fi
0 commit comments