Skip to content

Commit 160203f

Browse files
blackheavenfrasertweedale
authored andcommitted
feature(ci): skip rebuild when ./code does not change
1 parent deb5a67 commit 160203f

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,23 @@ on:
1717
- push
1818
- pull_request
1919
jobs:
20+
tools_changed:
21+
continue-on-error: true
22+
runs-on: ubuntu-20.04
23+
outputs:
24+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
25+
steps:
26+
- id: skip_check
27+
uses: fkirc/skip-duplicate-actions@master
28+
with:
29+
concurrent_skipping: "never"
30+
skip_after_successful_duplicate: "true"
31+
paths: '["code/**"]'
32+
do_not_skip: '["push", "workflow_dispatch", "schedule"]'
2033
linux:
2134
name: Haskell-CI - Linux - ${{ matrix.compiler }}
35+
needs: tools_changed
36+
if: ${{ needs.tools_changed.outputs.should_skip != 'true' }}
2237
runs-on: ubuntu-20.04
2338
timeout-minutes:
2439
60

.github/workflows/nix.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,23 @@ on:
55
- push
66
- pull_request
77
jobs:
8+
tools_changed:
9+
continue-on-error: true
10+
runs-on: ubuntu-22.04
11+
outputs:
12+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
13+
steps:
14+
- id: skip_check
15+
uses: fkirc/skip-duplicate-actions@master
16+
with:
17+
concurrent_skipping: "never"
18+
skip_after_successful_duplicate: "true"
19+
paths: '["code/**"]'
20+
do_not_skip: '["push", "workflow_dispatch", "schedule"]'
821
check_nix:
922
name: Check nix build
23+
needs: tools_changed
24+
if: ${{ needs.tools_changed.outputs.should_skip != 'true' }}
1025
runs-on: ubuntu-22.04
1126
steps:
1227
- name: git checkout
@@ -22,5 +37,5 @@ jobs:
2237
- uses: actions/upload-artifact@v3
2338
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
2439
with:
25-
name: hsec-tools
40+
name: hsec-tools-main
2641
path: code/hsec-tools/result/bin/hsec-tools

0 commit comments

Comments
 (0)