Skip to content

Commit

Permalink
WIP: Merge-Gate
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Sep 26, 2024
1 parent 67bb4c8 commit 06d7f13
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 17 deletions.
28 changes: 14 additions & 14 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:
Security:
name: Security Checking (Python-${{ matrix.python-version }})
needs: [ version-check-job ]
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
7 changes: 4 additions & 3 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

CI:
uses: ./.github/workflows/merge-gate.yml

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

on:
workflow_call:
secrets:
ALTERNATIVE_GITHUB_TOKEN:
required: false

jobs:

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

# This is an example of a saas-gate e.g. slow tests
slow-checks:
name: Slow
runs-on: ubuntu-latest
environment: manual-trigger
steps:
- name: Tests
run: |
echo "Approved (Note: This is a dummy)"
approve-merge:
name: Mergeable
runs-on: ubuntu-latest
needs: [ fast-checks, slow-checks ]

# Dummy step,
steps:
- name: Approve
run: |
echo "Merge Approved"

0 comments on commit 06d7f13

Please sign in to comment.