From a10639a68dc2dade175bac69246d2f00dd2caeae Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman Date: Thu, 2 Apr 2026 23:07:08 +0000 Subject: [PATCH] chore(ci): use matrix strategy for Python versions in unit and integration test jobs Add a matrix strategy to the unit_tests and integration_tests jobs in ci.yml so that tests run against all Python versions listed in SUPPORTED_PYTHONS in noxfile.py (currently ["3.13"]). Changes: - Add strategy.matrix.python-version to unit_tests and integration_tests - Set fail-fast: false so all matrix versions run even if one fails - Use matrix.python-version in the container image tag - Invoke nox with the versioned session name (e.g. unit_tests-3.13) - Scope uv cache keys per Python version to avoid cross-version pollution - Remove the now-unused global PYTHON_VERSION env var When SUPPORTED_PYTHONS is extended in noxfile.py, only the matrix list in ci.yml needs updating to add the new version. ISSUES CLOSED: #1539 --- .forgejo/workflows/ci.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 442a389c5..448108d05 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -8,7 +8,6 @@ on: env: UV_VERSION: "0.8.0" - PYTHON_VERSION: "3.13" NOX_DEFAULT_VENV_BACKEND: "uv" jobs: @@ -142,8 +141,12 @@ jobs: unit_tests: runs-on: docker + strategy: + matrix: + python-version: ["3.13"] + fail-fast: false container: - image: python:3.13-slim + image: python:${{ matrix.python-version }}-slim steps: - name: Install system dependencies (nodejs for checkout, git for merge tests, curl/tar for Helm) run: | @@ -172,20 +175,24 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/uv - key: uv-${{ hashFiles('pyproject.toml') }} + key: uv-tests-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} restore-keys: | - uv- + uv-tests-${{ matrix.python-version }}- - name: Run unit tests via nox run: | - nox -s unit_tests + nox -s "unit_tests-${{ matrix.python-version }}" env: NOX_DEFAULT_VENV_BACKEND: uv integration_tests: runs-on: docker + strategy: + matrix: + python-version: ["3.13"] + fail-fast: false container: - image: python:3.13-slim + image: python:${{ matrix.python-version }}-slim steps: - name: Install system dependencies (nodejs for checkout, git for integration tests, curl/tar for Helm) run: | @@ -214,13 +221,13 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/uv - key: uv-${{ hashFiles('pyproject.toml') }} + key: uv-tests-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} restore-keys: | - uv- + uv-tests-${{ matrix.python-version }}- - name: Run integration tests via nox run: | - nox -s integration_tests + nox -s "integration_tests-${{ matrix.python-version }}" env: NOX_DEFAULT_VENV_BACKEND: uv CLEVERAGENTS_REQUIRE_HELM_RENDER_ASSERTIONS: "true"