Skip to content

Commit 552b2c0

Browse files
committed
CI improvements
- Avoid double runs and redundant checks - Better branch matching - Add a summary step to avoid having to depend on each matrix job.
1 parent 866d011 commit 552b2c0

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,29 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
7-
- ?.?* # matches to backport branches, e.g. 3.6
6+
- 'master'
7+
- '[0-9].[0-9]+' # matches to backport branches, e.g. 3.6
88
tags: [ 'v*' ]
99
pull_request:
1010
branches:
11-
- master
12-
- ?.?*
11+
- 'master'
12+
- '[0-9].[0-9]+'
1313
schedule:
1414
- cron: '0 6 * * *' # Daily 6AM UTC build
1515

1616

1717
jobs:
18+
pre_job:
19+
runs-on: ubuntu-latest
20+
# Map a step output to a job output
21+
outputs:
22+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
23+
steps:
24+
- id: skip_check
25+
uses: fkirc/skip-duplicate-actions@master
26+
with:
27+
github_token: ${{ github.token }}
28+
paths_ignore: '["CHANGES/**", "CHANGES.rst", "LICENSE.txt", "README.rst", "tools/**"]'
1829

1930
lint:
2031
name: Linter
@@ -74,7 +85,9 @@ jobs:
7485
7586
test:
7687
name: Test
77-
needs: lint
88+
needs: [lint, pre_job]
89+
if: ${{ needs.pre_job.outputs.should_skip == 'false' }}
90+
7891
strategy:
7992
matrix:
8093
pyver: [3.6, 3.7, 3.8, 3.9]
@@ -121,6 +134,16 @@ jobs:
121134
flags: unit
122135
fail_ci_if_error: false
123136

137+
test-summary:
138+
name: Test matrix status
139+
if: ${{ always() }}
140+
runs-on: ubuntu-latest
141+
needs: test
142+
steps:
143+
- name: Check build matrix status
144+
if: ${{ needs.pre_job.outputs.should_skip == 'false' }}
145+
run: exit 1
146+
124147
deploy:
125148
name: Deploy
126149
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)