diff --git a/exasol/toolbox/templates/github/workflows/checks.yml b/exasol/toolbox/templates/github/workflows/checks.yml index 04896a795..0722e5b15 100644 --- a/exasol/toolbox/templates/github/workflows/checks.yml +++ b/exasol/toolbox/templates/github/workflows/checks.yml @@ -46,14 +46,17 @@ jobs: run: | poetry run python -m nox -s docs:build + build-matrix: + name: Generate Build Matrix + uses: ./.github/workflows/matrix-python.yml + Lint: name: Linting (Python-${{ matrix.python-version }}) needs: [ Version-Check ] runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] + matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} steps: - name: SCM Checkout @@ -80,8 +83,7 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] + matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} steps: - name: SCM Checkout @@ -101,8 +103,7 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] + matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} steps: - name: SCM Checkout @@ -135,6 +136,7 @@ jobs: uses: exasol/python-toolbox/.github/actions/python-environment@0.19.0 with: python-version: "3.9" + - name: Run format check run: poetry run nox -s project:format @@ -146,9 +148,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} strategy: fail-fast: false - matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] - exasol-version: ["7.1.9"] + matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} steps: - name: SCM Checkout @@ -160,7 +160,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Run Tests and Collect Coverage - run: poetry run nox -s test:unit -- -- --coverage --db-version ${{ matrix.exasol-version }} + run: poetry run nox -s test:unit -- -- --coverage - name: Upload Artifacts uses: actions/upload-artifact@v4.4.0 diff --git a/exasol/toolbox/templates/github/workflows/matrix-all.yml b/exasol/toolbox/templates/github/workflows/matrix-all.yml new file mode 100644 index 000000000..b23406b89 --- /dev/null +++ b/exasol/toolbox/templates/github/workflows/matrix-all.yml @@ -0,0 +1,30 @@ +name: Build Matrix (All Versions) + +on: + workflow_call: + outputs: + matrix: + description: "Generates the all versions build matrix" + value: ${{ jobs.all_versions.outputs.matrix }} + +jobs: + all_versions: + + runs-on: ubuntu-latest + + steps: + - name: SCM Checkout + uses: actions/checkout@v4 + + - name: Setup Python & Poetry Environment + uses: exasol/python-toolbox/.github/actions/python-environment@0.19.0 + + - name: Generate matrix + run: poetry run nox -s matrix:all + + - id: set-matrix + run: | + echo "matrix=$(poetry run nox -s matrix:all)" >> $GITHUB_OUTPUT + + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} diff --git a/exasol/toolbox/templates/github/workflows/matrix-exasol.yml b/exasol/toolbox/templates/github/workflows/matrix-exasol.yml new file mode 100644 index 000000000..279b5ae30 --- /dev/null +++ b/exasol/toolbox/templates/github/workflows/matrix-exasol.yml @@ -0,0 +1,30 @@ +name: Build Matrix (Exasol) + +on: + workflow_call: + outputs: + matrix: + description: "Generates the exasol version build matrix" + value: ${{ jobs.exasol_versions.outputs.matrix }} + +jobs: + exasol_versions: + + runs-on: ubuntu-latest + + steps: + - name: SCM Checkout + uses: actions/checkout@v4 + + - name: Setup Python & Poetry Environment + uses: exasol/python-toolbox/.github/actions/python-environment@0.19.0 + + - name: Generate matrix + run: poetry run nox -s matrix:exasol + + - id: set-matrix + run: | + echo "matrix=$(poetry run nox -s matrix:exasol)" >> $GITHUB_OUTPUT + + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} diff --git a/exasol/toolbox/templates/github/workflows/matrix-python.yml b/exasol/toolbox/templates/github/workflows/matrix-python.yml new file mode 100644 index 000000000..0ee1ee889 --- /dev/null +++ b/exasol/toolbox/templates/github/workflows/matrix-python.yml @@ -0,0 +1,30 @@ +name: Build Matrix (Python) + +on: + workflow_call: + outputs: + matrix: + description: "Generates the python version build matrix" + value: ${{ jobs.python_versions.outputs.matrix }} + +jobs: + python_versions: + + runs-on: ubuntu-latest + + steps: + - name: SCM Checkout + uses: actions/checkout@v4 + + - name: Setup Python & Poetry Environment + uses: exasol/python-toolbox/.github/actions/python-environment@0.19.0 + + - name: Generate matrix + run: poetry run nox -s matrix:python + + - id: set-matrix + run: | + echo "matrix=$(poetry run nox -s matrix:python)" >> $GITHUB_OUTPUT + + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} diff --git a/exasol/toolbox/templates/github/workflows/slow-checks.yml b/exasol/toolbox/templates/github/workflows/slow-checks.yml index 21d635921..b898e9ceb 100644 --- a/exasol/toolbox/templates/github/workflows/slow-checks.yml +++ b/exasol/toolbox/templates/github/workflows/slow-checks.yml @@ -8,8 +8,13 @@ on: jobs: + build-matrix: + name: Generate Build Matrix + uses: ./.github/workflows/matrix-all.yml + Tests: name: Integration-Tests (Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}}) + needs: [ build-matrix ] runs-on: ubuntu-latest # Even though the environment "manual-approval" will be created automatically, # it still needs to be configured to require interactive review. @@ -19,9 +24,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} strategy: fail-fast: false - matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] - exasol-version: [ "7.1.9" ] + matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} steps: - name: SCM Checkout