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 Aug 29, 2023
1 parent 6afcdc3 commit 94f2975
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 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
7 changes: 7 additions & 0 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ concurrency:
cancel-in-progress: true

jobs:
linters:
name: Quality
# Don't run linters 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"
Expand Down Expand Up @@ -94,6 +100,7 @@ jobs:
# The tests didn't run 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 94f2975

Please sign in to comment.