Skip to content

Commit 6ff9a4c

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 29d9d5b commit 6ff9a4c

File tree

3 files changed

+30
-21
lines changed

3 files changed

+30
-21
lines changed

.github/workflows/continuous_integration.yml

Lines changed: 5 additions & 13 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

@@ -14,27 +11,22 @@ env:
1411
# results from JRuby are complete.
1512
JRUBY_OPTS: --debug
1613

17-
# Supported platforms / Ruby versions:
18-
# - Ubuntu: MRI (3.1, 3.2, 3.3), TruffleRuby (24), JRuby (9.4)
19-
# - Windows: MRI (3.1), JRuby (9.4)
20-
2114
jobs:
2215
build:
2316
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}
2417

18+
if: >-
19+
github.event_name == 'workflow_dispatch' ||
20+
(github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))
21+
2522
runs-on: ${{ matrix.operating-system }}
2623
continue-on-error: true
2724

2825
strategy:
2926
fail-fast: false
3027
matrix:
31-
ruby: ["3.1", "3.2", "3.3", "jruby-9.4", "truffleruby-24"]
28+
ruby: ["3.1", "3.4"]
3229
operating-system: [ubuntu-latest]
33-
include:
34-
- ruby: "3.1"
35-
operating-system: windows-latest
36-
- ruby: "jruby-9.4"
37-
operating-system: windows-latest
3830

3931
steps:
4032
- 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: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,54 @@
11
name: Experimental Ruby Builds
22

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

96
env:
107
# SimpleCov suggests setting the JRuby --debug flag to ensure that coverage
118
# results from JRuby are complete.
129
JRUBY_OPTS: --debug
1310

14-
# Experimental platforms / Ruby versions:
15-
# - Ubuntu: MRI (head), TruffleRuby (head), JRuby (head)
16-
# - Windows: MRI (head), JRuby (head)
17-
1811
jobs:
1912
build:
2013
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}
2114

2215
runs-on: ${{ matrix.operating-system }}
2316
continue-on-error: true
2417

18+
env:
19+
FAIL_ON_LOW_COVERAGE: ${{ matrix.fail_on_low_coverage }}
20+
2521
strategy:
2622
fail-fast: false
2723
matrix:
2824
include:
25+
- ruby: "3.1"
26+
operating-system: windows-latest
27+
fail_on_low_coverage: "false"
2928
- ruby: head
3029
operating-system: ubuntu-latest
30+
fail_on_low_coverage: "true"
3131
- ruby: head
3232
operating-system: windows-latest
33-
- ruby: truffleruby-head
33+
fail_on_low_coverage: "false"
34+
- ruby: "jruby-9.4"
3435
operating-system: ubuntu-latest
36+
fail_on_low_coverage: "false"
37+
- ruby: "jruby-9.4"
38+
operating-system: windows-latest
39+
fail_on_low_coverage: "false"
3540
- ruby: jruby-head
3641
operating-system: ubuntu-latest
42+
fail_on_low_coverage: "false"
3743
- ruby: jruby-head
3844
operating-system: windows-latest
45+
fail_on_low_coverage: "false"
46+
- ruby: "truffleruby-24"
47+
operating-system: ubuntu-latest
48+
fail_on_low_coverage: "false"
49+
- ruby: truffleruby-head
50+
operating-system: ubuntu-latest
51+
fail_on_low_coverage: "false"
3952

4053
steps:
4154
- name: Checkout

0 commit comments

Comments
 (0)