Skip to content

Commit cce4b1d

Browse files
authored
build: github action enable Skip Duplicate Actions. (#1078)
Setup Skip Duplicate Actions in the workflow. The reason for doing this, is that githubs path-ignore feature does not play well with required checks on master. Skip Duplicate Actions include a better paths_ignore feature. https://github.com/marketplace/actions/skip-duplicate-actions
1 parent 26aef9c commit cce4b1d

File tree

1 file changed

+59
-22
lines changed

1 file changed

+59
-22
lines changed

.github/workflows/build-raven.yml

+59-22
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,66 @@ on:
99
- master
1010
- develop
1111
- release*
12-
paths-ignore:
13-
- 'binaries/**'
14-
- 'community/**'
15-
- 'contrib/**'
16-
- 'doc/**'
17-
- 'roadmap/**'
18-
- 'share/**'
19-
- 'static-builds/**'
20-
- 'whitepaper/**'
21-
- '*.md'
12+
# paths-ignore:
13+
# - 'binaries/**'
14+
# - 'community/**'
15+
# - 'contrib/**'
16+
# - 'doc/**'
17+
# - 'roadmap/**'
18+
# - 'share/**'
19+
# - 'static-builds/**'
20+
# - 'whitepaper/**'
21+
# - '*.md'
2222

2323
env:
2424
SCRIPTS: ${{ GITHUB.WORKSPACE }}/.github/scripts
2525

2626
jobs:
27-
build:
27+
check-jobs:
28+
# continue-on-error: true # Uncomment once integration is finished
29+
runs-on: ubuntu-18.04
30+
# Map a step output to a job output
31+
outputs:
32+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
33+
steps:
34+
- id: skip_check
35+
uses: fkirc/skip-duplicate-actions@master
36+
with:
37+
# All of these options are optional, so you can remove them if you are happy with the defaults
38+
concurrent_skipping: 'never'
39+
skip_after_successful_duplicate: 'true'
40+
paths_ignore: '[
41+
"binaries/**",
42+
"community/**",
43+
"contrib/**",
44+
"doc/**",
45+
"roadmap/**",
46+
"share/**",
47+
"static-builds/**",
48+
"whitepaper/**",
49+
"**/*.md"
50+
]'
51+
do_not_skip: '["workflow_dispatch", "schedule"]'
2852

53+
build:
54+
needs: check-jobs
2955
runs-on: ubuntu-18.04
3056
strategy:
3157
matrix:
3258
OS: [ 'windows', 'linux', 'linux-disable-wallet', 'arm32v7', 'arm32v7-disable-wallet', 'aarch64', 'aarch64-disable-wallet' ]
3359
# OS: [ 'windows', 'linux', 'linux-disable-wallet', 'osx', 'arm32v7', 'arm32v7-disable-wallet' ]
3460

3561
steps:
36-
- name: Checkout the Code
62+
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
63+
name: Checkout the Code
3764
uses: actions/checkout@v1
3865

39-
- name: Install Build Tools
66+
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
67+
name: Install Build Tools
4068
run: sudo ${SCRIPTS}/00-install-deps.sh ${{ MATRIX.OS }}
4169

42-
- name: Cache dependencies.
70+
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
71+
name: Cache dependencies.
4372
uses: actions/cache@v2
4473
with:
4574
path: |
@@ -48,28 +77,36 @@ jobs:
4877
${{ GITHUB.WORKSPACE }}/depends/work
4978
key: ${{ MATRIX.OS }}
5079

51-
- name: Build dependencies.
80+
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
81+
name: Build dependencies.
5282
run: ${SCRIPTS}/02-copy-build-dependencies.sh ${{ MATRIX.OS }} ${{ GITHUB.WORKSPACE }} ${{ GITHUB.BASE_REF }} ${{ GITHUB.REF }}
5383

54-
- name: Add Dependencies to the System PATH
84+
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
85+
name: Add Dependencies to the System PATH
5586
run: ${SCRIPTS}/03-export-path.sh ${{ MATRIX.OS }} ${{ GITHUB.WORKSPACE }}
5687

57-
- name: Build Config
88+
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
89+
name: Build Config
5890
run: cd ${{ GITHUB.WORKSPACE }} && ./autogen.sh
5991

60-
- name: Configure Build
92+
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
93+
name: Configure Build
6194
run: ${SCRIPTS}/04-configure-build.sh ${{ MATRIX.OS }} ${{ GITHUB.WORKSPACE }}
6295

63-
- name: Build Raven
96+
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
97+
name: Build Raven
6498
run: make -j2
6599

66-
- name: Check Binary Security
100+
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
101+
name: Check Binary Security
67102
run: ${SCRIPTS}/05-binary-checks.sh ${{ MATRIX.OS }} ${{ GITHUB.WORKSPACE }}
68103

69-
- name: Package Up the Build
104+
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
105+
name: Package Up the Build
70106
run: ${SCRIPTS}/06-package.sh ${{ MATRIX.OS }} ${{ GITHUB.WORKSPACE }} ${{ GITHUB.BASE_REF }} ${{ GITHUB.REF }}
71107

72-
- name: Upload Artifacts to Job
108+
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
109+
name: Upload Artifacts to Job
73110
uses: actions/upload-artifact@master
74111
with:
75112
name: ${{ MATRIX.OS }}

0 commit comments

Comments
 (0)