Skip to content

Commit

Permalink
🎨🧪 Wire linters into the main CI workflow
Browse files Browse the repository at this point in the history
This patch makes the quality workflow definition into reusable. It
doesn't need to track the same triggers and conditions as the main
one. Additionally, the `alls-green` check can now take into account
the outcome of linting making it possible to only have one job in
the branch protection.
  • Loading branch information
webknjaz committed Jul 12, 2023
1 parent 7a32450 commit 4fe3333
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
name: "Quality"

on:
push:
branches:
- master
- nedbat/*
pull_request:
workflow_dispatch:
workflow_call:

defaults:
run:
Expand All @@ -21,10 +16,6 @@ env:
permissions:
contents: read

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
lint:
name: "Pylint etc"
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ concurrency:
cancel-in-progress: true

jobs:
linters:
name: Quality
# Don't run pipeline if the branch name includes "-notests"
if: "!contains(github.ref, '-notests')"
uses: ./.github/workflows/reusable-quality.yml

tests:
name: "${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}-latest"
# Don't run tests if the branch name includes "-notests"
# Don't run pipeline if the branch name includes "-notests"
if: "!contains(github.ref, '-notests')"
strategy:
matrix:
Expand Down Expand Up @@ -91,9 +97,10 @@ jobs:
# https://github.com/orgs/community/discussions/33579
success:
name: Tests successful
# The tests didn't run if the branch name includes "-notests"
# Don't run pipeline if the branch name includes "-notests"
if: "!contains(github.ref, '-notests')"
needs:
- linters
- tests
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 4fe3333

Please sign in to comment.