Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/workflows/matrix-all.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/matrix-exasol.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/matrix-python.yml

This file was deleted.

79 changes: 79 additions & 0 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Generated and maintained by the exasol-toolbox.
# Last generated with exasol-toolbox version 8.1.1.
name: Build Matrix

on:
workflow_call:
inputs:
matrix_keys_json:
description: "JSON array of BaseConfig keys to include in the generated matrix output."
required: true
type: string
outputs:
matrix:
description: "Generates the requested build matrix"
value: ${{ jobs.set-matrix.outputs.matrix }}

jobs:
set-matrix:
runs-on: "ubuntu-24.04"
permissions:
contents: read
steps:
- name: Check out Repository
id: check-out-repository
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Set up Python & Poetry Environment
id: set-up-python-and-poetry-environment
uses: exasol/python-toolbox/.github/actions/python-environment@v8
with:
python-version: "3.10"
poetry-version: "2.3.0"

- name: Parse Matrix Keys
id: parse-matrix-keys
env:
MATRIX_KEYS_JSON: ${{ inputs.matrix_keys_json }}
run: |
python - <<'PY'
import json
import os

matrix_keys = json.loads(os.environ["MATRIX_KEYS_JSON"])
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output_file:
print(f"matrix_keys_json={json.dumps(matrix_keys)}", file=output_file)
PY

- name: Generate Matrix
id: set-matrix
env:
MATRIX_KEYS_JSON: ${{ steps.parse-matrix-keys.outputs.matrix_keys_json }}
run: |
python - <<'PY'
import json
import os
import subprocess

matrix_keys = json.loads(os.environ["MATRIX_KEYS_JSON"])
matrix_json = subprocess.check_output(
[
"poetry",
"run",
"--",
"nox",
"-s",
"matrix:generate",
"--",
*matrix_keys,
],
text=True,
).strip()
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output_file:
print(f"matrix={matrix_json}", file=output_file)
PY

outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
10 changes: 6 additions & 4 deletions .github/workflows/slow-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ on:
jobs:
build-matrix:
name: Build Matrix
uses: ./.github/workflows/matrix-python.yml
uses: ./.github/workflows/matrix.yml
with:
matrix_keys_json: '["python_versions"]'
permissions:
contents: read

run-integration-tests:
name: Run Integration Tests (Python-${{ matrix.python-version }})
name: Run Integration Tests (Python-${{ matrix.python_versions }})
needs:
- build-matrix
runs-on: "ubuntu-24.04"
Expand All @@ -31,7 +33,7 @@ jobs:
id: set-up-python-and-poetry-environment
uses: exasol/python-toolbox/.github/actions/python-environment@v8
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python_versions }}
poetry-version: "2.3.0"

- name: Run Integration Tests
Expand All @@ -42,7 +44,7 @@ jobs:
id: upload-artifacts
uses: actions/upload-artifact@v7
with:
name: coverage-python${{ matrix.python-version }}-slow
name: coverage-python${{ matrix.python_versions }}-slow
path: .coverage
include-hidden-files: true
overwrite: false
12 changes: 7 additions & 5 deletions .github/workflows/test-python-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ jobs:
needs:
- check-changes
if: needs.check-changes.outputs.should_run == 'true'
uses: ./.github/workflows/matrix-all.yml
uses: ./.github/workflows/matrix.yml
with:
matrix_keys_json: '["python_versions"]'
permissions:
contents: read

Expand All @@ -60,8 +62,8 @@ jobs:
- int-linux-x64-4core-gpu-t4-ubuntu24.04-1
- int-linux-x64-4core-ubuntu24.04-1
- int-linux-x64-2core-ubuntu24.04-1
python-version: ${{ fromJson(needs.build-matrix.outputs.matrix).python-version }}
name: Verify Poetry Setup for ${{ matrix.runner }} (Python-${{ matrix.python-version }})
python-versions: ${{ fromJson(needs.build-matrix.outputs.matrix).python_versions }}
name: Verify Poetry Setup for ${{ matrix.runner }} (Python-${{ matrix.python-versions }})
runs-on:
labels: ${{ matrix.runner }}
steps:
Expand All @@ -75,7 +77,7 @@ jobs:
id: set-up-python-and-poetry-environment
uses: ./.github/actions/python-environment
with:
python-version: "${{ matrix.python-version }}"
python-version: "${{ matrix.python-versions }}"
poetry-version: "2.3.0"

- name: Check Poetry Version
Expand All @@ -85,7 +87,7 @@ jobs:
- name: Validate Python Version
id: validate-python-version
env:
PYTHON_VERSION: ${{ matrix.python-version }}
PYTHON_VERSION: ${{ matrix.python-versions }}
run: |
poetry run which python
poetry run python --version
Expand Down
4 changes: 4 additions & 0 deletions doc/user_guide/features/github_workflows/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ Maintained by the PTB
- Workflow call
- Calls Nox session ``matrix:all``, which typically evaluates ``exasol_versions``
and ``python_versions`` from the ``PROJECT_CONFIG``.
* - ``matrix.yml``
- Workflow call
- Calls Nox session ``matrix:generate`` with one or more space-separated
``BaseConfig`` keys to build a custom matrix from the ``PROJECT_CONFIG``.
* - ``matrix-exasol.yml``
- Workflow call
- Calls Nox session ``matrix:exasol`` to get the ``exasol_versions`` from the
Expand Down
Loading