Skip to content

Commit 4fe3333

Browse files
committed
🎨🧪 Wire linters into the main CI workflow
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.
1 parent 7a32450 commit 4fe3333

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

‎.github/workflows/quality.yml renamed to ‎.github/workflows/reusable-quality.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
name: "Quality"
55

66
on:
7-
push:
8-
branches:
9-
- master
10-
- nedbat/*
11-
pull_request:
12-
workflow_dispatch:
7+
workflow_call:
138

149
defaults:
1510
run:
@@ -21,10 +16,6 @@ env:
2116
permissions:
2217
contents: read
2318

24-
concurrency:
25-
group: "${{ github.workflow }}-${{ github.ref }}"
26-
cancel-in-progress: true
27-
2819
jobs:
2920
lint:
3021
name: "Pylint etc"

‎.github/workflows/testsuite.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ concurrency:
2828
cancel-in-progress: true
2929

3030
jobs:
31+
linters:
32+
name: Quality
33+
# Don't run pipeline if the branch name includes "-notests"
34+
if: "!contains(github.ref, '-notests')"
35+
uses: ./.github/workflows/reusable-quality.yml
36+
3137
tests:
3238
name: "${{ matrix.python-version }} on ${{ matrix.os }}"
3339
runs-on: "${{ matrix.os }}-latest"
34-
# Don't run tests if the branch name includes "-notests"
40+
# Don't run pipeline if the branch name includes "-notests"
3541
if: "!contains(github.ref, '-notests')"
3642
strategy:
3743
matrix:
@@ -91,9 +97,10 @@ jobs:
9197
# https://github.com/orgs/community/discussions/33579
9298
success:
9399
name: Tests successful
94-
# The tests didn't run if the branch name includes "-notests"
100+
# Don't run pipeline if the branch name includes "-notests"
95101
if: "!contains(github.ref, '-notests')"
96102
needs:
103+
- linters
97104
- tests
98105
runs-on: ubuntu-latest
99106
steps:

0 commit comments

Comments
 (0)