Skip to content

Commit 9e0320c

Browse files
authored
Merge pull request #110 from rails/rm-ruby-scripts
Rewrite add-ruby-version in Ruby
2 parents 13fc03b + 3f11500 commit 9e0320c

11 files changed

Lines changed: 765 additions & 472 deletions

.devcontainer/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
"features": {
88
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
9+
"ghcr.io/rails/devcontainer/features/ruby": {
10+
"version": "4.0.1"
11+
},
912
"ghcr.io/devcontainers/features/github-cli": {}
1013
},
1114

.github/ruby-versions.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[
2+
"4.0.0",
3+
"3.4.8",
4+
"3.4.7",
5+
"3.4.6",
6+
"3.4.5",
7+
"3.4.4",
8+
"3.4.3",
9+
"3.4.2",
10+
"3.4.1",
11+
"3.4.0",
12+
"3.3.10",
13+
"3.3.9",
14+
"3.3.8",
15+
"3.3.7",
16+
"3.3.6",
17+
"3.3.5",
18+
"3.3.4",
19+
"3.3.3",
20+
"3.3.2",
21+
"3.3.1",
22+
"3.3.0",
23+
"3.2.9",
24+
"3.2.8",
25+
"3.2.7",
26+
"3.2.6",
27+
"3.2.5",
28+
"3.2.4",
29+
"3.2.3",
30+
"3.2.2",
31+
"3.2.1",
32+
"3.2.0"
33+
]

.github/workflows/publish-new-image-version.yaml

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,22 @@ name: Build and Publish Images
44
tags:
55
- ruby-*.*.*
66
jobs:
7+
setup:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
matrix: ${{ steps.set-matrix.outputs.matrix }}
11+
steps:
12+
- uses: actions/checkout@v4
13+
- id: set-matrix
14+
run: echo "matrix=$(cat .github/ruby-versions.json | jq -c '.')" >> $GITHUB_OUTPUT
15+
716
build:
817
name: Build Images
18+
needs: setup
919
strategy:
1020
fail-fast: false
1121
matrix:
12-
RUBY_VERSION:
13-
- 4.0.0
14-
- 3.4.8
15-
- 3.4.7
16-
- 3.4.6
17-
- 3.4.5
18-
- 3.4.4
19-
- 3.4.3
20-
- 3.4.2
21-
- 3.4.1
22-
- 3.4.0
23-
- 3.3.10
24-
- 3.3.9
25-
- 3.3.8
26-
- 3.3.7
27-
- 3.3.6
28-
- 3.3.5
29-
- 3.3.4
30-
- 3.3.3
31-
- 3.3.2
32-
- 3.3.1
33-
- 3.3.0
34-
- 3.2.9
35-
- 3.2.8
36-
- 3.2.7
37-
- 3.2.6
38-
- 3.2.5
39-
- 3.2.4
40-
- 3.2.3
41-
- 3.2.2
42-
- 3.2.1
43-
- 3.2.0
22+
RUBY_VERSION: ${{ fromJSON(needs.setup.outputs.matrix) }}
4423
runs-on: ubuntu-latest
4524
permissions:
4625
contents: read

.github/workflows/test-features.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,33 @@ jobs:
6565
- name: "Run shellcheck"
6666
working-directory: features
6767
run: find . -name "*.sh" -type f -exec shellcheck {} +
68+
69+
ruby-tests:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v4
73+
74+
- name: Set up Ruby
75+
uses: ruby/setup-ruby@v1
76+
with:
77+
ruby-version: .ruby-version
78+
bundler-cache: true
79+
80+
- name: Run tests
81+
run: bundle exec rake test
82+
83+
ci:
84+
runs-on: ubuntu-latest
85+
needs: [test-autogenerated, test-scenarios, shellcheck, ruby-tests]
86+
if: always()
87+
steps:
88+
- name: Check CI status
89+
run: |
90+
if [[ "${{ needs.test-autogenerated.result }}" == "failure" ]] || \
91+
[[ "${{ needs.test-scenarios.result }}" == "failure" ]] || \
92+
[[ "${{ needs.shellcheck.result }}" == "failure" ]] || \
93+
[[ "${{ needs.ruby-tests.result }}" == "failure" ]]; then
94+
echo "One or more jobs failed"
95+
exit 1
96+
fi
97+
echo "All jobs passed successfully"

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.0.1

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
gem "minitest"
6+
gem "rake"

Gemfile.lock

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
minitest (6.0.1)
5+
prism (~> 1.5)
6+
prism (1.9.0)
7+
rake (13.3.1)
8+
9+
PLATFORMS
10+
aarch64-linux
11+
ruby
12+
13+
DEPENDENCIES
14+
minitest
15+
rake
16+
17+
CHECKSUMS
18+
minitest (6.0.1) sha256=7854c74f48e2e975969062833adc4013f249a4b212f5e7b9d5c040bf838d54bb
19+
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
20+
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
21+
22+
BUNDLED WITH
23+
4.0.3

Rakefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
require "rake/testtask"
4+
5+
Rake::TestTask.new(:test) do |t|
6+
t.libs << "test"
7+
t.pattern = "test/**/*_test.rb"
8+
t.verbose = true
9+
end
10+
11+
task default: :test

0 commit comments

Comments
 (0)