Skip to content

Commit 61a4226

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 61a4226

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

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

+1-10
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

+8-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
name: "Tests"
55

6+
if: >- # Don't run pipeline if the branch name includes "-notests"
7+
!contains(github.ref, '-notests')
8+
69
on:
710
push:
811
branches:
@@ -28,11 +31,13 @@ concurrency:
2831
cancel-in-progress: true
2932

3033
jobs:
34+
linters:
35+
name: Quality
36+
uses: ./.github/workflows/reusable-quality.yml
37+
3138
tests:
3239
name: "${{ matrix.python-version }} on ${{ matrix.os }}"
3340
runs-on: "${{ matrix.os }}-latest"
34-
# Don't run tests if the branch name includes "-notests"
35-
if: "!contains(github.ref, '-notests')"
3641
strategy:
3742
matrix:
3843
os:
@@ -91,9 +96,8 @@ jobs:
9196
# https://github.com/orgs/community/discussions/33579
9297
success:
9398
name: Tests successful
94-
# The tests didn't run if the branch name includes "-notests"
95-
if: "!contains(github.ref, '-notests')"
9699
needs:
100+
- linters
97101
- tests
98102
runs-on: ubuntu-latest
99103
steps:

0 commit comments

Comments
 (0)