Skip to content

Commit 34167d5

Browse files
authored
[ ci ] controlling builds via commit messages (#1766)
1 parent 74db771 commit 34167d5

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/ci-idris2.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,56 @@ on:
66
- '*'
77
tags:
88
- '*'
9+
paths-ignore:
10+
- 'docs/**'
11+
- 'icons/**'
12+
- '*.md'
13+
- 'CONTRIBUTORS'
14+
- 'LICENSE'
15+
- '.github/workflows/ci-lint.yml'
16+
- '.github/workflows/ci-sphinx.yml'
17+
- '.github/workflows/ci-super-linter.yml'
918
pull_request:
1019
branches:
1120
- master
1221
- main
22+
paths-ignore:
23+
- 'docs/**'
24+
- 'icons/**'
25+
- '*.md'
26+
- 'CONTRIBUTORS'
27+
- 'LICENSE'
28+
- '.github/workflows/ci-lint.yml'
29+
- '.github/workflows/ci-sphinx.yml'
30+
- '.github/workflows/ci-super-linter.yml'
1331

1432
env:
1533
IDRIS2_VERSION: 0.4.0 # For previous-version build
1634

1735
jobs:
1836

37+
initialise:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout Project
41+
uses: actions/checkout@v2
42+
with:
43+
# for pull_request so we can do HEAD^2
44+
fetch-depth: 2
45+
46+
- name: Get commit message
47+
id: get_commit_message
48+
run: |
49+
if [[ '${{ github.event_name }}' == 'push' ]]; then
50+
echo ::set-output name=commit_message::$(git log --format=%B -n 1 HEAD)
51+
elif [[ '${{ github.event_name }}' == 'pull_request' ]]; then
52+
echo ::set-output name=commit_message::$(git log --format=%B -n 1 HEAD^2)
53+
fi
54+
55+
outputs:
56+
commit_message:
57+
echo "${{ steps.get_commit_message.outputs.commit_message }}"
58+
1959
######################################################################
2060
# Build from the previous version
2161
# We perform this check before all the other ones because:
@@ -24,7 +64,10 @@ jobs:
2464
######################################################################
2565

2666
quick-check:
67+
needs: initialise
2768
runs-on: ubuntu-latest
69+
if: |
70+
!contains(needs.initialise.outputs.commit_message, '[ci: skip]')
2871
env:
2972
IDRIS2_CG: chez
3073
SCHEME: scheme
@@ -79,6 +122,10 @@ jobs:
79122
ubuntu-bootstrap-chez:
80123
needs: quick-check
81124
runs-on: ubuntu-latest
125+
if: |
126+
!contains(needs.initialise.outputs.commit_message, '[ci:')
127+
|| contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]')
128+
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]')
82129
env:
83130
IDRIS2_CG: chez
84131
SCHEME: scheme
@@ -104,6 +151,10 @@ jobs:
104151
macos-bootstrap-chez:
105152
needs: quick-check
106153
runs-on: macos-latest
154+
if: |
155+
!contains(needs.initialise.outputs.commit_message, '[ci:')
156+
|| contains(needs.initialise.outputs.commit_message, '[ci: macos]')
157+
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]')
107158
env:
108159
SCHEME: chez
109160
steps:
@@ -128,6 +179,10 @@ jobs:
128179
windows-bootstrap-chez:
129180
needs: quick-check
130181
runs-on: windows-latest
182+
if: |
183+
!contains(needs.initialise.outputs.commit_message, '[ci:')
184+
|| contains(needs.initialise.outputs.commit_message, '[ci: windows]')
185+
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]')
131186
env:
132187
MSYSTEM: MINGW64
133188
MSYS2_PATH_TYPE: inherit
@@ -173,6 +228,10 @@ jobs:
173228
nix-bootstrap-chez:
174229
needs: quick-check
175230
runs-on: ubuntu-latest
231+
if: |
232+
!contains(needs.initialise.outputs.commit_message, '[ci:')
233+
|| contains(needs.initialise.outputs.commit_message, '[ci: nix]')
234+
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]')
176235
steps:
177236
- uses: actions/checkout@v2
178237
with:
@@ -187,6 +246,10 @@ jobs:
187246
ubuntu-bootstrap-racket:
188247
needs: quick-check
189248
runs-on: ubuntu-latest
249+
if: |
250+
!contains(needs.initialise.outputs.commit_message, '[ci:')
251+
|| contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]')
252+
|| contains(needs.initialise.outputs.commit_message, '[ci: racket]')
190253
env:
191254
IDRIS2_CG: racket
192255
steps:
@@ -292,6 +355,9 @@ jobs:
292355
ubuntu-self-host-previous-version:
293356
needs: quick-check
294357
runs-on: ubuntu-latest
358+
if: |
359+
!contains(needs.initialise.outputs.commit_message, '[ci:')
360+
|| contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]')
295361
env:
296362
IDRIS2_CG: chez
297363
steps:

0 commit comments

Comments
 (0)