Skip to content

Commit fb5ba84

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 12b9337 commit fb5ba84

File tree

2 files changed

+67
-64
lines changed

2 files changed

+67
-64
lines changed

.github/workflows/main.yml renamed to .github/workflows/continuous_integration.yml

+17-14
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
1-
name: CI Build
1+
name: Continuous Integration
22

33
on:
4-
push:
5-
branches: [ main ]
6-
74
pull_request:
8-
branches: [ main ]
5+
branches: [main]
6+
7+
workflow_dispatch:
98

109
jobs:
1110
build:
11+
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}
12+
13+
if: >-
14+
github.event_name == 'workflow_dispatch' ||
15+
(github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))
16+
17+
runs-on: ${{ matrix.operating-system }}
1218
continue-on-error: true
1319

20+
env:
21+
FAIL_ON_LOW_COVERAGE: ${{ matrix.fail_on_low_coverage }}
22+
1423
strategy:
24+
fail-fast: false
1525
matrix:
16-
ruby: ['3.1', '3.4', jruby-head]
26+
ruby: ["3.1", "3.4"]
1727
operating-system: [ubuntu-latest]
18-
include:
19-
- ruby: '3.1'
20-
operating-system: windows-latest
21-
- ruby: jruby-head
22-
operating-system: windows-latest
23-
24-
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}
25-
runs-on: ${{ matrix.operating-system }}
28+
fail_on_low_coverage: [true]
2629

2730
steps:
2831
- name: Checkout

.github/workflows/release.yml

+50-50
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
---
2-
name: Release Gem
3-
description: |
4-
This workflow creates a new release on GitHub and publishes the gem to
5-
RubyGems.org.
6-
7-
The workflow uses the `googleapis/release-please-action` to handle the
8-
release creation process and the `rubygems/release-gem` action to publish
9-
the gem.
10-
11-
on:
12-
push:
13-
branches: ["main"]
14-
15-
workflow_dispatch:
16-
17-
jobs:
18-
release:
19-
runs-on: ubuntu-latest
20-
21-
environment:
22-
name: RubyGems
23-
url: https://rubygems.org/gems/github_pages_rake_tasks
24-
25-
permissions:
26-
contents: write
27-
pull-requests: write
28-
id-token: write
29-
30-
steps:
31-
- name: Checkout project
32-
uses: actions/checkout@v4
33-
34-
- name: Create release
35-
uses: googleapis/release-please-action@v4
36-
id: release
37-
with:
38-
token: ${{ secrets.AUTO_RELEASE_TOKEN }}
39-
config-file: release-please-config.json
40-
manifest-file: .release-please-manifest.json
41-
42-
- name: Setup ruby
43-
uses: ruby/setup-ruby@v1
44-
if: ${{ steps.release.outputs.release_created }}
45-
with:
46-
bundler-cache: true
47-
ruby-version: ruby
48-
49-
- name: Push to RubyGems.org
50-
uses: rubygems/release-gem@v1
51-
if: ${{ steps.release.outputs.release_created }}
2+
name: Release Gem
3+
description: |
4+
This workflow creates a new release on GitHub and publishes the gem to
5+
RubyGems.org.
6+
7+
The workflow uses the `googleapis/release-please-action` to handle the
8+
release creation process and the `rubygems/release-gem` action to publish
9+
the gem.
10+
11+
on:
12+
push:
13+
branches: ["main"]
14+
15+
workflow_dispatch:
16+
17+
jobs:
18+
release:
19+
runs-on: ubuntu-latest
20+
21+
environment:
22+
name: RubyGems
23+
url: https://rubygems.org/gems/process_executer
24+
25+
permissions:
26+
contents: write
27+
pull-requests: write
28+
id-token: write
29+
30+
steps:
31+
- name: Checkout project
32+
uses: actions/checkout@v4
33+
34+
- name: Create release
35+
uses: googleapis/release-please-action@v4
36+
id: release
37+
with:
38+
token: ${{ secrets.AUTO_RELEASE_TOKEN }}
39+
config-file: release-please-config.json
40+
manifest-file: .release-please-manifest.json
41+
42+
- name: Setup ruby
43+
uses: ruby/setup-ruby@v1
44+
if: ${{ steps.release.outputs.release_created }}
45+
with:
46+
bundler-cache: true
47+
ruby-version: ruby
48+
49+
- name: Push to RubyGems.org
50+
uses: rubygems/release-gem@v1
51+
if: ${{ steps.release.outputs.release_created }}

0 commit comments

Comments
 (0)