Skip to content

Commit 0d652a9

Browse files
authored
Merge pull request #163 from fluent/ruby_versions.yml
CI: Introduce ruby_versions.yml to add supported Ruby versions automatically
2 parents aa793d9 + 9549454 commit 0d652a9

File tree

4 files changed

+49
-17
lines changed

4 files changed

+49
-17
lines changed

.github/workflows/coverage.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ jobs:
66
coverage:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v6
1010
- name: Set up Ruby 3.0
1111
uses: ruby/setup-ruby@v1
1212
with:
1313
ruby-version: '3.1'
1414
- name: Build and test with Rake
1515
run: |
16-
gem install bundler
1716
bundle install
1817
bundle exec rake
1918
- name: Coveralls GitHub Action

.github/workflows/linux.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
11
name: Testing on Ubuntu
22
on:
3-
- push
4-
- pull_request
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
schedule:
8+
- cron: '0 0 1 * *'
59
jobs:
10+
ruby-versions:
11+
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
12+
with:
13+
engine: cruby
14+
min_version: 3.1
615
build:
16+
needs: ruby-versions
717
runs-on: ${{ matrix.os }}
818
strategy:
919
fail-fast: false
1020
matrix:
11-
ruby: [ '3.1', '3.2', '3.3', '3.4' ]
21+
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
22+
exclude:
23+
- ruby: head
1224
os:
1325
- ubuntu-latest
1426
name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
1527
steps:
16-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v6
1729
- uses: ruby/setup-ruby@v1
1830
with:
1931
ruby-version: ${{ matrix.ruby }}
2032
- name: unit testing
2133
env:
2234
CI: true
2335
run: |
24-
gem install bundler rake
2536
bundle config set path 'vendor/bundle'
2637
bundle install --jobs 4 --retry 3
2738
bundle exec rake test

.github/workflows/macos.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
11
name: Testing on macOS
22
on:
3-
- push
4-
- pull_request
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
schedule:
8+
- cron: '0 0 1 * *'
59
jobs:
10+
ruby-versions:
11+
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
12+
with:
13+
engine: cruby
14+
min_version: 3.1
615
build:
16+
needs: ruby-versions
717
runs-on: ${{ matrix.os }}
818
strategy:
919
fail-fast: false
1020
matrix:
11-
ruby: [ '3.1', '3.2', '3.3', '3.4' ]
21+
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
22+
exclude:
23+
- ruby: head
1224
os:
1325
- macOS-latest
1426
name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
1527
steps:
16-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v6
1729
- uses: ruby/setup-ruby@v1
1830
with:
1931
ruby-version: ${{ matrix.ruby }}
2032
- name: unit testing
2133
env:
2234
CI: true
2335
run: |
24-
gem install bundler rake
2536
bundle install --jobs 4 --retry 3
2637
bundle exec rake test

.github/workflows/windows.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
11
name: Testing on Windows
22
on:
3-
- push
4-
- pull_request
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
schedule:
8+
- cron: '0 0 1 * *'
59
jobs:
10+
ruby-versions:
11+
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
12+
with:
13+
engine: cruby
14+
min_version: 3.1
615
build:
16+
needs: ruby-versions
717
runs-on: ${{ matrix.os }}
818
strategy:
919
fail-fast: false
1020
matrix:
11-
ruby: [ '3.1', '3.2', '3.3', '3.4' ]
21+
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
22+
exclude:
23+
- ruby: head
1224
os:
1325
- windows-latest
1426
name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
1527
steps:
16-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v6
1729
- uses: ruby/setup-ruby@v1
1830
with:
1931
ruby-version: ${{ matrix.ruby }}
2032
- name: unit testing
2133
env:
2234
CI: true
2335
run: |
24-
gem install bundler rake
2536
bundle install --jobs 4 --retry 3
2637
bundle exec rake test

0 commit comments

Comments
 (0)