Skip to content

Commit b7f7295

Browse files
authored
Merge pull request #4766 from stacks-network/fix/reduce_ci_runs-master
[CI] 4746 - Avoid extraneous CI runs (master)
2 parents 9775102 + 2a729d3 commit b7f7295

File tree

1 file changed

+33
-50
lines changed

1 file changed

+33
-50
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ on:
2424
- reopened
2525
- synchronize
2626
- ready_for_review
27-
paths-ignore:
28-
- "**.md"
29-
- "**.yml"
30-
## might be better to use inclusive v exclusive paths here, ex:
31-
# paths:
32-
# - "**.rs"
33-
# - "**.clar"
34-
pull_request_review:
35-
types:
36-
- submitted
3727

3828
defaults:
3929
run:
@@ -55,15 +45,6 @@ jobs:
5545
## - PR review comment
5646
## - PR change is requested
5747
rustfmt:
58-
if: |
59-
!(
60-
github.event_name == 'pull_request_review' &&
61-
github.event.action == 'submitted' &&
62-
(
63-
github.event.review.state == 'commented' ||
64-
github.event.review.state == 'changes_requested'
65-
)
66-
)
6748
name: Rust Format
6849
runs-on: ubuntu-latest
6950
steps:
@@ -104,22 +85,9 @@ jobs:
10485
##
10586
## Runs when:
10687
## - tag is not provided
107-
## and the following are not true:
108-
## - PR review submitted (not approved)
109-
## and any of:
110-
## - PR review comment
111-
## - PR change is requested
11288
docker-image:
11389
if: |
114-
inputs.tag == '' &&
115-
!(
116-
github.event_name == 'pull_request_review' &&
117-
github.event.action == 'submitted' &&
118-
(
119-
github.event.review.state == 'commented' ||
120-
github.event.review.state == 'changes_requested'
121-
)
122-
)
90+
inputs.tag == ''
12391
name: Docker Image (Source)
12492
uses: ./.github/workflows/image-build-source.yml
12593
needs:
@@ -133,19 +101,13 @@ jobs:
133101
## or:
134102
## - no tag provided
135103
## and any of:
136-
## - PR is approved (any approval will trigger)
137104
## - this workflow is called manually
138105
## - PR is opened
139106
## - commit to either (development, master) branch
140107
create-cache:
141108
if: |
142109
inputs.tag != '' || (
143110
inputs.tag == '' && (
144-
(
145-
github.event_name == 'pull_request_review' &&
146-
github.event.action == 'submitted' &&
147-
github.event.review.state == 'approved'
148-
) ||
149111
github.event_name == 'workflow_dispatch' ||
150112
github.event_name == 'pull_request' ||
151113
github.event_name == 'merge_group' ||
@@ -168,16 +130,28 @@ jobs:
168130
##
169131
## Runs when:
170132
## - tag is provided
171-
## either or of the following:
172-
## - tag is not provided
173-
## - PR is approved
133+
## or:
134+
## - no tag provided
135+
## and any of:
136+
## - this workflow is called manually
137+
## - PR is opened
138+
## - PR added to merge queue
139+
## - commit to either (development, next, master) branch
174140
stacks-core-tests:
175141
if: |
176142
inputs.tag != '' || (
177-
inputs.tag == '' || (
178-
github.event_name == 'pull_request_review' &&
179-
github.event.action == 'submitted' &&
180-
github.event.review.state == 'approved'
143+
inputs.tag == '' && (
144+
github.event_name == 'workflow_dispatch' ||
145+
github.event_name == 'pull_request' ||
146+
github.event_name == 'merge_group' ||
147+
(
148+
contains('
149+
refs/heads/master
150+
refs/heads/develop
151+
refs/heads/next
152+
', github.event.pull_request.head.ref) &&
153+
github.event_name == 'push'
154+
)
181155
)
182156
)
183157
name: Stacks Core Tests
@@ -189,10 +163,18 @@ jobs:
189163
bitcoin-tests:
190164
if: |
191165
inputs.tag != '' || (
192-
inputs.tag == '' || (
193-
github.event_name == 'pull_request_review' &&
194-
github.event.action == 'submitted' &&
195-
github.event.review.state == 'approved'
166+
inputs.tag == '' && (
167+
github.event_name == 'workflow_dispatch' ||
168+
github.event_name == 'pull_request' ||
169+
github.event_name == 'merge_group' ||
170+
(
171+
contains('
172+
refs/heads/master
173+
refs/heads/develop
174+
refs/heads/next
175+
', github.event.pull_request.head.ref) &&
176+
github.event_name == 'push'
177+
)
196178
)
197179
)
198180
name: Bitcoin Tests
@@ -228,3 +210,4 @@ jobs:
228210
- rustfmt
229211
- create-cache
230212
uses: ./.github/workflows/slow-tests.yml
213+

0 commit comments

Comments
 (0)