Skip to content

Commit 88d6c8c

Browse files
committed
fix: do not trigger build workflows after merging to main or for release PRs
Since all merges to the main branch must be a fast-forward rebase, CI builds should not be run when merged to main. They are run via the pull request before merging. The continuous_integration workflow should be triggered for pull requests targeting main. The experimental_ruby_builds workflow should only be triggered manually via the GitHub UI. Move unneeded builds from continuous_integration to experimental_ruby_builds There is not a good reason to have a specific builds in the continuous_integration workflow on Windows, or using JRuby or TruffleRuby.
1 parent 18a75a0 commit 88d6c8c

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

.github/workflows/continuous_integration.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Continuous Integration
22

33
on:
4-
push:
5-
branches: [main]
6-
74
pull_request:
85
branches: [main]
96

@@ -22,6 +19,10 @@ jobs:
2219
build:
2320
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}
2421

22+
if: >-
23+
github.event_name == 'workflow_dispatch' ||
24+
(github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))
25+
2526
runs-on: ${{ matrix.operating-system }}
2627
continue-on-error: true
2728

@@ -34,19 +35,6 @@ jobs:
3435
ruby: ["3.1", "3.4"]
3536
operating-system: [ubuntu-latest]
3637
fail_on_low_coverage: ["true"]
37-
include:
38-
- ruby: "jruby-9.4"
39-
operating-system: ubuntu-latest
40-
fail_on_low_coverage: "false"
41-
- ruby: "truffleruby-24"
42-
operating-system: ubuntu-latest
43-
fail_on_low_coverage: "false"
44-
- ruby: "3.1"
45-
operating-system: windows-latest
46-
fail_on_low_coverage: "false"
47-
- ruby: "jruby-9.4"
48-
operating-system: windows-latest
49-
fail_on_low_coverage: "false"
5038

5139
steps:
5240
- name: Checkout

.github/workflows/enforce_conventional_commits.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ jobs:
99
commit-lint:
1010
name: Verify Conventional Commits
1111

12+
if: >-
13+
github.event_name == 'workflow_dispatch' ||
14+
(github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))
15+
1216
runs-on: ubuntu-latest
1317

1418
steps:

.github/workflows/experimental_ruby_builds.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Experimental Ruby Builds
22

33
on:
4-
push:
5-
branches: [main]
6-
74
workflow_dispatch:
85

96
env:
@@ -29,21 +26,33 @@ jobs:
2926
fail-fast: false
3027
matrix:
3128
include:
29+
- ruby: "3.1"
30+
operating-system: windows-latest
31+
fail_on_low_coverage: "false"
3232
- ruby: head
3333
operating-system: ubuntu-latest
3434
fail_on_low_coverage: "true"
3535
- ruby: head
3636
operating-system: windows-latest
3737
fail_on_low_coverage: "false"
38-
- ruby: truffleruby-head
38+
- ruby: "jruby-9.4"
3939
operating-system: ubuntu-latest
4040
fail_on_low_coverage: "false"
41+
- ruby: "jruby-9.4"
42+
operating-system: windows-latest
43+
fail_on_low_coverage: "false"
4144
- ruby: jruby-head
4245
operating-system: ubuntu-latest
4346
fail_on_low_coverage: "false"
4447
- ruby: jruby-head
4548
operating-system: windows-latest
4649
fail_on_low_coverage: "false"
50+
- ruby: "truffleruby-24"
51+
operating-system: ubuntu-latest
52+
fail_on_low_coverage: "false"
53+
- ruby: truffleruby-head
54+
operating-system: ubuntu-latest
55+
fail_on_low_coverage: "false"
4756

4857
steps:
4958
- name: Checkout

0 commit comments

Comments
 (0)