Skip to content

Commit 716d29a

Browse files
committed
CI: Introduce ruby_versions.yml to add supported Ruby versions automatically
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
1 parent c1d5382 commit 716d29a

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

.github/workflows/linux.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
name: Testing on Ubuntu
22
on:
3-
- push
4-
- pull_request
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
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: 2.7
615
build:
16+
needs: ruby-versions
717
runs-on: ${{ matrix.os }}
818
strategy:
919
fail-fast: false
1020
matrix:
11-
ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0' ]
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 }}
@@ -21,6 +33,5 @@ jobs:
2133
env:
2234
CI: true
2335
run: |
24-
gem install rake
2536
bundle install --jobs 4 --retry 3
2637
bundle exec rake test

.github/workflows/windows.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
name: Testing on Windows
22
on:
3-
- push
4-
- pull_request
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
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: 2.7
615
build:
16+
needs: ruby-versions
717
runs-on: ${{ matrix.os }}
818
strategy:
919
fail-fast: false
1020
matrix:
11-
ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0' ]
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 }}
@@ -21,6 +33,5 @@ jobs:
2133
env:
2234
CI: true
2335
run: |
24-
gem install rake
2536
bundle install --jobs 4 --retry 3
2637
bundle exec rake test

0 commit comments

Comments
 (0)