Skip to content

Commit 274efa3

Browse files
add missing sdist skip job (haskell#10452)
There's little point in having a skip-on-docs trigger if there's no alternative, cf. the comment in validate.yml. (cherry picked from commit 01b9fdb) Co-authored-by: brandon s allbery kf8nh <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent ec2542f commit 274efa3

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Check sdist Skip
2+
3+
# This Workflow is special and contains a workaround for a known limitation of GitHub CI.
4+
#
5+
# The problem: We don't want to run the "check sdist" jobs on PRs which contain only changes
6+
# to the docs, since these jobs take a long time to complete without providing any benefit.
7+
# We therefore use path-filtering in the workflow triggers for the check sdist jobs, namely
8+
# "paths-ignore: doc/**". But the "Check sdist post job" is a required job, therefore a PR cannot
9+
# be merged unless the "Bootstrap post job" completes succesfully, which it doesn't do if we
10+
# filter it out.
11+
#
12+
# The solution: We use a second job with the same name which always returns the exit code 0.
13+
# The logic implemented for "required" workflows accepts if 1) at least one job with that name
14+
# runs through, AND 2) If multiple jobs of that name exist, then all jobs of that name have to
15+
# finish successfully.
16+
on:
17+
push:
18+
paths:
19+
- 'doc/**'
20+
- '**/README.md'
21+
- 'CONTRIBUTING.md'
22+
- "changelog.d/**"
23+
# only top level for these, because various test packages have them too
24+
- "*/ChangeLog.md"
25+
- "*/changelog.md"
26+
- "release-notes/**"
27+
branches:
28+
- master
29+
pull_request:
30+
paths:
31+
- 'doc/**'
32+
- '**/README.md'
33+
- 'CONTRIBUTING.md'
34+
- "changelog.d/**"
35+
- "*/ChangeLog.md"
36+
- "*/changelog.md"
37+
- "release-notes/**"
38+
release:
39+
types:
40+
- created
41+
42+
jobs:
43+
check-sdist-post-job:
44+
if: always()
45+
name: Check sdist post job
46+
runs-on: ubuntu-latest
47+
steps:
48+
- run: exit 0

.github/workflows/check-sdist.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,17 @@ jobs:
8080
echo No matching bootlib Cabal version to test against.
8181
exit 0
8282
fi
83+
84+
check-sdist-post-job:
85+
if: always()
86+
name: Check sdist post job
87+
runs-on: ubuntu-latest
88+
# IMPORTANT! Any job added to the workflow should be added here too
89+
needs: [dogfood-sdists]
90+
91+
steps:
92+
- run: |
93+
echo "jobs info: ${{ toJSON(needs) }}"
94+
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
95+
run: exit 1
96+

0 commit comments

Comments
 (0)