Skip to content

Commit

Permalink
Add support for merge gate and rename jobs and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Sep 26, 2024
1 parent 67bb4c8 commit 9c43ea1
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 21 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:

jobs:

version-check-job:
name: Version Check
Version-Check:
name: Version
runs-on: ubuntu-latest

steps:
Expand All @@ -24,9 +24,9 @@ jobs:
- name: Check Version(s)
run: poetry run version-check `poetry run python -c "from noxconfig import PROJECT_CONFIG; print(PROJECT_CONFIG.version_file)"`

build-documentation-job:
name: Build Documentation
needs: [ version-check-job ]
Documentation:
name: Docs
needs: [ Version-Check ]
runs-on: ubuntu-latest

steps:
Expand All @@ -40,9 +40,9 @@ jobs:
run: |
poetry run python -m nox -s build-docs
lint-job:
Lint:
name: Linting (Python-${{ matrix.python-version }})
needs: [ version-check-job ]
needs: [ Version-Check ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -68,9 +68,9 @@ jobs:
path: .lint.txt
include-hidden-files: true

type-check-job:
Type-Check:
name: Type Checking (Python-${{ matrix.python-version }})
needs: [ version-check-job ]
needs: [ Version-Check ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -89,9 +89,9 @@ jobs:
- name: Run type-check
run: poetry run nox -s type-check

security-job:
name: Security Checking (Python-${{ matrix.python-version }})
needs: [ version-check-job ]
Security:
name: Security Checks (Python-${{ matrix.python-version }})
needs: [ Version-Check ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -107,7 +107,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Run security
- name: Run security linter
run: poetry run nox -s security

- name: Upload Artifacts
Expand All @@ -117,9 +117,9 @@ jobs:
path: .security.json
include-hidden-files: true

tests-job:
Tests:
name: Tests (Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}})
needs: [ build-documentation-job, lint-job, type-check-job ]
needs: [ Documentation, Lint, Type-Check, Security]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ on:
- cron: "0 0 1/7 * *"

jobs:
ci-job:
uses: ./.github/workflows/checks.yml

metrics:
needs: [ ci-job ]
CI:
uses: ./.github/workflows/merge-gate.yml

Metrics:
needs: [ CI ]
uses: ./.github/workflows/report.yml
33 changes: 33 additions & 0 deletions .github/workflows/merge-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Merge-Gate

on:
workflow_call:
secrets:
ALTERNATIVE_GITHUB_TOKEN:
required: false

jobs:

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

slow-checks:
name: Slow
runs-on: ubuntu-latest
environment: manual-approval
steps:
- name: Tests
run: |
echo "Approved (Note: This is a dummy)"
approve-merge:
name: Mergeable
runs-on: ubuntu-latest
needs: [ fast-checks, slow-checks ]

# steps:
# - name: Approve
# run: |
# echo "Merge Approved"
3 changes: 1 addition & 2 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:

jobs:

report:
name: Generate Status Report
Report:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 9c43ea1

Please sign in to comment.