diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 486cd6ab4..37a7c4983 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -48,12 +48,6 @@ jobs: run: | poetry run -- nox -s links:check - build-matrix: - name: Generate Build Matrix - uses: ./.github/workflows/matrix-python.yml - permissions: - contents: read - Changelog: name: Changelog Update Check runs-on: "ubuntu-24.04" @@ -74,14 +68,15 @@ jobs: run: poetry run -- nox -s changelog:updated Lint: - name: Linting (Python-${{ matrix.python-version }}) - needs: [ Version-Check, build-matrix ] + name: Linting (Python-${{ matrix.python-versions }}) + needs: [ Version-Check ] runs-on: "ubuntu-24.04" permissions: contents: read strategy: fail-fast: false - matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} + matrix: + python-versions: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - name: SCM Checkout uses: actions/checkout@v6 @@ -89,7 +84,7 @@ jobs: - name: Setup Python & Poetry Environment uses: ./.github/actions/python-environment with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python-versions }} poetry-version: "2.3.0" - name: Run lint @@ -98,21 +93,22 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v6 with: - name: lint-python${{ matrix.python-version }} + name: lint-python${{ matrix.python-versions }} path: | .lint.txt .lint.json include-hidden-files: true Type-Check: - name: Type Checking (Python-${{ matrix.python-version }}) - needs: [ Version-Check, build-matrix ] + name: Type Checking (Python-${{ matrix.python-versions }}) + needs: [ Version-Check ] runs-on: "ubuntu-24.04" permissions: contents: read strategy: fail-fast: false - matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} + matrix: + python-versions: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - name: SCM Checkout @@ -121,21 +117,22 @@ jobs: - name: Setup Python & Poetry Environment uses: ./.github/actions/python-environment with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python-versions }} poetry-version: "2.3.0" - name: Run type-check run: poetry run -- nox -s lint:typing Security: - name: Security Checks (Python-${{ matrix.python-version }}) - needs: [ Version-Check, build-matrix ] + name: Security Checks (Python-${{ matrix.python-versions }}) + needs: [ Version-Check ] runs-on: "ubuntu-24.04" permissions: contents: read strategy: fail-fast: false - matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} + matrix: + python-versions: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - name: SCM Checkout @@ -144,7 +141,7 @@ jobs: - name: Setup Python & Poetry Environment uses: ./.github/actions/python-environment with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python-versions }} poetry-version: "2.3.0" - name: Run security linter @@ -153,7 +150,7 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v6 with: - name: security-python${{ matrix.python-version }} + name: security-python${{ matrix.python-versions }} path: .security.json include-hidden-files: true @@ -214,14 +211,15 @@ jobs: run: poetry run -- nox -s lint:import Tests: - name: Unit-Tests (Python-${{ matrix.python-version }}) - needs: [ Build-Packages, Lint-Imports, build-matrix ] + name: Unit-Tests (Python-${{ matrix.python-versions }}) + needs: [ Build-Packages, Lint-Imports ] runs-on: "ubuntu-24.04" permissions: contents: read strategy: fail-fast: false - matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} + matrix: + python-versions: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - name: SCM Checkout @@ -233,7 +231,7 @@ jobs: - name: Setup Python & Poetry Environment uses: ./.github/actions/python-environment with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python-versions }} poetry-version: "2.3.0" - name: Run Tests and Collect Coverage @@ -242,6 +240,6 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v6 with: - name: coverage-python${{ matrix.python-version }}-fast + name: coverage-python${{ matrix.python-versions }}-fast path: .coverage include-hidden-files: true diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index fb4737052..549f78b52 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -1,3 +1,7 @@ # Unreleased ## Summary + +## Feature + +* #673: Switched `checks.yml` to get Python versions for matrix from `BaseConfig` diff --git a/exasol/toolbox/config.py b/exasol/toolbox/config.py index 4b771e268..47ac24ff0 100644 --- a/exasol/toolbox/config.py +++ b/exasol/toolbox/config.py @@ -277,4 +277,5 @@ def github_template_dict(self) -> dict[str, Any]: "dependency_manager_version": self.dependency_manager.version, "minimum_python_version": self.minimum_python_version, "os_version": self.os_version, + "python_versions": self.python_versions, } diff --git a/exasol/toolbox/templates/github/workflows/checks.yml b/exasol/toolbox/templates/github/workflows/checks.yml index 7c658c6f5..231ada753 100644 --- a/exasol/toolbox/templates/github/workflows/checks.yml +++ b/exasol/toolbox/templates/github/workflows/checks.yml @@ -48,12 +48,6 @@ jobs: run: | poetry run -- nox -s links:check - build-matrix: - name: Generate Build Matrix - uses: ./.github/workflows/matrix-python.yml - permissions: - contents: read - Changelog: name: Changelog Update Check runs-on: "(( os_version ))" @@ -74,14 +68,15 @@ jobs: run: poetry run -- nox -s changelog:updated Lint: - name: Linting (Python-${{ matrix.python-version }}) - needs: [ Version-Check, build-matrix ] + name: Linting (Python-${{ matrix.python-versions }}) + needs: [ Version-Check ] runs-on: "(( os_version ))" permissions: contents: read strategy: fail-fast: false - matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} + matrix: + python-versions: (( python_versions | tojson )) steps: - name: SCM Checkout uses: actions/checkout@v6 @@ -89,7 +84,7 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python-versions }} poetry-version: "(( dependency_manager_version ))" - name: Run lint @@ -98,21 +93,22 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v6 with: - name: lint-python${{ matrix.python-version }} + name: lint-python${{ matrix.python-versions }} path: | .lint.txt .lint.json include-hidden-files: true Type-Check: - name: Type Checking (Python-${{ matrix.python-version }}) - needs: [ Version-Check, build-matrix ] + name: Type Checking (Python-${{ matrix.python-versions }}) + needs: [ Version-Check ] runs-on: "(( os_version ))" permissions: contents: read strategy: fail-fast: false - matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} + matrix: + python-versions: (( python_versions | tojson )) steps: - name: SCM Checkout @@ -121,21 +117,22 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python-versions }} poetry-version: "(( dependency_manager_version ))" - name: Run type-check run: poetry run -- nox -s lint:typing Security: - name: Security Checks (Python-${{ matrix.python-version }}) - needs: [ Version-Check, build-matrix ] + name: Security Checks (Python-${{ matrix.python-versions }}) + needs: [ Version-Check ] runs-on: "(( os_version ))" permissions: contents: read strategy: fail-fast: false - matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} + matrix: + python-versions: (( python_versions | tojson )) steps: - name: SCM Checkout @@ -144,7 +141,7 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python-versions }} poetry-version: "(( dependency_manager_version ))" - name: Run security linter @@ -153,7 +150,7 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v6 with: - name: security-python${{ matrix.python-version }} + name: security-python${{ matrix.python-versions }} path: .security.json include-hidden-files: true @@ -196,14 +193,15 @@ jobs: run: poetry run -- nox -s package:check Tests: - name: Unit-Tests (Python-${{ matrix.python-version }}) - needs: [ Build-Packages, build-matrix ] + name: Unit-Tests (Python-${{ matrix.python-versions }}) + needs: [ Build-Packages ] runs-on: "(( os_version ))" permissions: contents: read strategy: fail-fast: false - matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} + matrix: + python-versions: (( python_versions | tojson )) steps: - name: SCM Checkout @@ -212,7 +210,7 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python-versions }} poetry-version: "(( dependency_manager_version ))" - name: Run Tests and Collect Coverage @@ -221,6 +219,6 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v6 with: - name: coverage-python${{ matrix.python-version }}-fast + name: coverage-python${{ matrix.python-versions }}-fast path: .coverage include-hidden-files: true diff --git a/test/unit/config_test.py b/test/unit/config_test.py index c2790dbb4..cba1e54b4 100644 --- a/test/unit/config_test.py +++ b/test/unit/config_test.py @@ -38,6 +38,13 @@ def test_works_as_defined(test_project_config_factory): "dependency_manager_version": "2.3.0", "minimum_python_version": "3.10", "os_version": "ubuntu-24.04", + "python_versions": ( + "3.10", + "3.11", + "3.12", + "3.13", + "3.14", + ), }, "minimum_python_version": "3.10", "os_version": "ubuntu-24.04",