Skip to content

Commit

Permalink
Restructed GH workflows for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuben committed Nov 19, 2024
1 parent e74fc13 commit aa6ca55
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 54 deletions.
31 changes: 2 additions & 29 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,32 +119,5 @@ jobs:
include-hidden-files: true

Tests:
name: Tests (Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}})
needs: [ Documentation, Lint, Type-Check, Security ]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
exasol-version: ["7.1.9"]

steps:
- name: SCM Checkout
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Run Tests and Compute Coverage
run: poetry run nox -s test:coverage -- -- --db-version ${{ matrix.exasol-version }}

- name: Upload Artifacts
uses: actions/[email protected]
with:
name: coverage-python${{ matrix.python-version }}
path: .coverage
include-hidden-files: true
name: Tests
uses: ./.github/workflows/tests.yml
30 changes: 5 additions & 25 deletions .github/workflows/merge-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,19 @@ on:

jobs:

fast-checks:
name: Fast
checks:
name: Checks
uses: ./.github/workflows/checks.yml

slow-checks:
name: Slow
runs-on: ubuntu-latest

# Even though the environment "manual-approval" will be created automatically,
# it still needs to be configured to require interactive review.
# See project settings on GitHub (Settings / Environments / manual-approval).
environment: manual-approval

# Replace the steps below with the required actions
# and/or add additional jobs if required
# Note:
# If you add additional jobs, make sure they are added as a requirement
# to the approve-merge job's input requirements (needs).
steps:
- name: Tests
run: |
echo "Slow tests ran successfully"
# This job ensures inputs have been executed successfully.
approve-merge:
name: Allow Merge
name: Allow Merge
runs-on: ubuntu-latest
# If you need additional jobs to be part of the merge gate, add them below
needs: [ fast-checks, slow-checks ]
needs: [ checks ]

# Each job requires a step, so we added this dummy step.
steps:
- name: Approve
- name: Approve
run: |
echo "Merge Approved"
61 changes: 61 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Tests

on:
workflow_call:
secrets:
ALTERNATIVE_GITHUB_TOKEN:
required: false

jobs:

Tests:
name: Tests (Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}})
runs-on: ubuntu-latest
env:
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"]

steps:
- name: SCM Checkout
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Run Unit Tests
run: poetry run nox -s test:unit

- name: Run Unit Tests
run: poetry run coverage report -m

- name: Upload Artifacts
uses: actions/[email protected]
with:
name: coverage-python${{ matrix.python-version }}
path: .coverage
include-hidden-files: true

Slow-Tests:
name: Slow
runs-on: ubuntu-latest

# Even though the environment "manual-approval" will be created automatically,
# it still needs to be configured to require interactive review.
# See project settings on GitHub (Settings / Environments / manual-approval).
environment: manual-approval

# Replace the steps below with the required actions
# and/or add additional jobs if required
# Note:
# If you add additional jobs, make sure they are added as a requirement
# to the approve-merge job's input requirements (needs).
steps:
- name: Tests
run: |
echo "Slow tests ran successfully"

0 comments on commit aa6ca55

Please sign in to comment.