@@ -111,11 +111,7 @@ test-python:
111111 parallel:
112112 matrix:
113113 - PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"]
114- OS_IMAGE: ["bookworm-slim"]
115- # Add cross-platform testing for latest Python version
116- - PYTHON_VERSION: ["3.13"]
117- OS_IMAGE: ["alpine", "bookworm-slim"]
118- image: ghcr.io/astral-sh/uv:latest-python$PYTHON_VERSION-$OS_IMAGE
114+ image: ghcr.io/astral-sh/uv:latest-python$PYTHON_VERSION-bookworm-slim
119115 script:
120116 - uvx nox -s tests-python-${PYTHON_VERSION//.}
121117 after_script:
@@ -138,6 +134,64 @@ test-python:
138134 - ".coveragerc"
139135 - ".gitlab-ci.yml"
140136
137+ # Cross-platform testing with macOS (GitLab.com SaaS runners)
138+ test-python-macos:
139+ stage: test
140+ <<: *on-merge-requests-and-main
141+ tags:
142+ - saas-macos-medium-m1
143+ before_script:
144+ - curl -LsSf https://astral.sh/uv/install.sh | sh
145+ - export PATH="$PATH:$HOME/.cargo/bin"
146+ script:
147+ - uvx nox -s tests-python-3.13
148+ artifacts:
149+ reports:
150+ junit: tests/results/*.xml
151+ coverage_report:
152+ coverage_format: cobertura
153+ path: coverage.xml
154+ paths:
155+ - tests/results/
156+ - coverage.xml
157+ expire_in: 5 days
158+ changes:
159+ - "src/**/*.py"
160+ - "tests/**/*.py"
161+ - "noxfile.py"
162+ - "pyproject.toml"
163+ - ".coveragerc"
164+ - ".gitlab-ci.yml"
165+
166+ # Cross-platform testing with Windows (GitLab.com SaaS runners)
167+ test-python-windows:
168+ stage: test
169+ <<: *on-merge-requests-and-main
170+ tags:
171+ - saas-windows-medium-amd64
172+ before_script:
173+ - powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
174+ - $env:PATH += ";$env:USERPROFILE\.cargo\bin"
175+ script:
176+ - uvx nox -s tests-python-3.13
177+ artifacts:
178+ reports:
179+ junit: tests/results/*.xml
180+ coverage_report:
181+ coverage_format: cobertura
182+ path: coverage.xml
183+ paths:
184+ - tests/results/
185+ - coverage.xml
186+ expire_in: 5 days
187+ changes:
188+ - "src/**/*.py"
189+ - "tests/**/*.py"
190+ - "noxfile.py"
191+ - "pyproject.toml"
192+ - ".coveragerc"
193+ - ".gitlab-ci.yml"
194+
141195{% if cookiecutter.add_rust_extension == 'y' -%}
142196# Rust-specific jobs (conditional on rust extension flag)
143197.rust-job: &rust-job
@@ -215,7 +269,22 @@ pages:
215269 - "noxfile.py"
216270 - "pyproject.toml"
217271
218- # Release Job (only on tags)
272+ # Test Release Job (TestPyPI)
273+ test-release-python:
274+ stage: release
275+ <<: *uv-cache
276+ script:
277+ - export PYPI_URL=https://test.pypi.org/legacy/
278+ - uvx nox -s publish-python
279+ after_script:
280+ - uv cache prune --ci
281+ rules:
282+ - if: $CI_COMMIT_TAG
283+ environment:
284+ name: test
285+ url: https://test.pypi.org/project/{{ cookiecutter.package_name }}/
286+
287+ # Production Release Job (PyPI)
219288release-python:
220289 stage: release
221290 <<: *uv-cache
@@ -228,3 +297,6 @@ release-python:
228297 environment:
229298 name: production
230299 url: https://pypi.org/project/{{ cookiecutter.package_name }}/
300+ needs:
301+ - test-release-python
302+ when: manual
0 commit comments