Skip to content

Commit

Permalink
Update workflow templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Dec 11, 2024
1 parent bd5c0d3 commit a98ab06
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 13 deletions.
20 changes: 10 additions & 10 deletions exasol/toolbox/templates/github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -135,6 +136,7 @@ jobs:
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: "3.9"

- name: Run format check
run: poetry run nox -s project:format

Expand All @@ -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
Expand All @@ -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/[email protected]
Expand Down
30 changes: 30 additions & 0 deletions exasol/toolbox/templates/github/workflows/matrix-all.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

- 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 }}
30 changes: 30 additions & 0 deletions exasol/toolbox/templates/github/workflows/matrix-exasol.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

- 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 }}
30 changes: 30 additions & 0 deletions exasol/toolbox/templates/github/workflows/matrix-python.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

- 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 }}
9 changes: 6 additions & 3 deletions exasol/toolbox/templates/github/workflows/slow-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit a98ab06

Please sign in to comment.