Skip to content

Commit

Permalink
ci: prepare for next rails release
Browse files Browse the repository at this point in the history
- rails/main is now 8.0.0.alpha
- rails/7-2-stable is likely the next 7.2 release

This currently checks out the 7.2 pre-release from Git (just like
the main branch). When 7.2 is properly released, I need to do some
cleanup.

This also changes the location of the rbenv gemset directories from
`./.gems/$ruby_version` to `./gemfiles/rails-*/.gems`. This allows to
keep the gemset small (by means of `bundle clean --force`).
  • Loading branch information
dmke committed May 14, 2024
1 parent c5f2993 commit 13aad56
Show file tree
Hide file tree
Showing 7 changed files with 368 additions and 63 deletions.
21 changes: 20 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,26 @@ updates:
- version-update:semver-minor

- package-ecosystem: "bundler"
directory: "/gemfiles/rails-main"
directory: "/gemfiles/rails-7.1"
schedule:
interval: "daily"
time: "08:30"
timezone: "Europe/Berlin"
ignore:
- dependency-name: "rails"
update-types: # keep only patch level
- version-update:semver-major
- version-update:semver-minor

- package-ecosystem: "bundler"
directory: "/gemfiles/rails-7.2" # pre-release
schedule:
interval: "weekly" # volatile, avoid daily PRs
time: "08:30"
timezone: "Europe/Berlin"

- package-ecosystem: "bundler"
directory: "/gemfiles/rails-main" # 8.0 dev
schedule:
interval: "weekly" # volatile, avoid daily PRs
time: "08:30"
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/rails-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ on:
jobs:
test:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
name: Ruby ${{ matrix.ruby }}/Rails ${{ matrix.rails }}
strategy:
matrix:
ruby: ['3.1', '3.2']
rails: ['main', '7.2-stable']

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails-main/Gemfile
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails-${{ matrix.rails }}/Gemfile

steps:
- uses: actions/checkout@v4
Expand Down
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test: test-stable rubocop
test-stable: rails-6.0 rails-6.1 rails-7.0 rails-7.1

.PHONY: test-all
test-all: test rails-main
test-all: test rails-main rails-7.2

.PHONY: rails-6.0
rails-6.0:
Expand All @@ -29,17 +29,33 @@ rails-7.1:
bin/make-helper.sh 7.1 bundle --quiet && \
bin/make-helper.sh 7.1 rspec $(SPEC)

.PHONY: rails-7.2
rails-7.2:
bin/make-helper.sh 7.2 bundle --quiet && \
bin/make-helper.sh 7.2 rspec $(SPEC)

.PHONY: rails-main
rails-main:
bin/make-helper.sh main bundle --quiet && \
bin/make-helper.sh main rspec $(SPEC)

.PHONY: setup
setup:
bin/make-helper.sh 6.0 gem install bundler:2.4.22
bin/make-helper.sh 6.1 gem install bundler:2.4.22
bin/make-helper.sh 7.0 gem install bundler:2.4.22
bin/make-helper.sh 7.1 gem install bundler:2.4.22
bin/make-helper.sh 7.2 gem install bundler:2.5.6
bin/make-helper.sh main gem install bundler:2.5.6
bin/make-helper.sh . gem install bundler:2.4.22

.PHONY: update
update:
bin/make-helper.sh 6.0 bundle update
bin/make-helper.sh 6.1 bundle update
bin/make-helper.sh 7.0 bundle update
bin/make-helper.sh 7.1 bundle update
bin/make-helper.sh 7.2 bundle update
bin/make-helper.sh main bundle update
bin/make-helper.sh . bundle update

Expand Down
12 changes: 10 additions & 2 deletions bin/make-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ err() {

ruby_ver=
gemdir=
gemset_dir=
rails_ver="$1"
shift

Expand All @@ -49,10 +50,17 @@ case "$rails_ver" in
".")
gemdir=""
ruby_ver="2.7"
gemset_dir="./gems/project"
;;
"main")
gemdir="gemfiles/rails-main"
ruby_ver="3.1"
gemset_dir="./gems/rails-main"
;;
"7.2")
gemdir="gemfiles/rails-7.2-stable"
ruby_ver="3.1"
gemset_dir="./gems/rails-7.2"
;;
*)
gemdir="gemfiles/rails-${rails_ver}"
Expand All @@ -73,13 +81,13 @@ if [ "z$ruby_ver" = "z$(cat "${root}/.ruby-version")" ]; then
else
log "switching Ruby to $ruby_ver"
echo "$ruby_ver" > "${root}/.ruby-version"
echo "./.gems/$ruby_ver" > "${root}/.ruby-gemset"
echo "./${gemdir}/.gems" > "${root}/.ruby-gemset"
fi
export BUNDLE_GEMFILE="./$gemdir/Gemfile"

# run CMD; prefix with "bundle exec", unless CMD starts with "bundle"
case "$1" in
"bundle")
"bundle"|"gem")
exec "$@"
;;
*)
Expand Down
15 changes: 15 additions & 0 deletions gemfiles/rails-7.2-stable/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

source "https://rubygems.org"
gemspec path: "../.."

gem "pry-byebug"
gem "rails", github: "rails/rails", branch: "7-2-stable"

# keep in sync with ../../Gemfile
group :development, :test do
gem "combustion"
gem "rake", "~> 13.0"
gem "rspec", "~> 3.0"
gem "rspec-rails"
end
246 changes: 246 additions & 0 deletions gemfiles/rails-7.2-stable/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
GIT
remote: https://github.com/rails/rails.git
revision: 35cc53410669a366eab8de335742b0096d06abb7
branch: 7-2-stable
specs:
actioncable (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
activejob (= 7.2.0.alpha)
activerecord (= 7.2.0.alpha)
activestorage (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
mail (>= 2.8.0)
actionmailer (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
actionview (= 7.2.0.alpha)
activejob (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.2.0.alpha)
actionview (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
activerecord (= 7.2.0.alpha)
activestorage (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.2.0.alpha)
activesupport (= 7.2.0.alpha)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.2.0.alpha)
activesupport (= 7.2.0.alpha)
globalid (>= 0.3.6)
activemodel (7.2.0.alpha)
activesupport (= 7.2.0.alpha)
activerecord (7.2.0.alpha)
activemodel (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
timeout (>= 0.4.0)
activestorage (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
activejob (= 7.2.0.alpha)
activerecord (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
marcel (~> 1.0)
activesupport (7.2.0.alpha)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1, < 5.22.0)
tzinfo (~> 2.0, >= 2.0.5)
rails (7.2.0.alpha)
actioncable (= 7.2.0.alpha)
actionmailbox (= 7.2.0.alpha)
actionmailer (= 7.2.0.alpha)
actionpack (= 7.2.0.alpha)
actiontext (= 7.2.0.alpha)
actionview (= 7.2.0.alpha)
activejob (= 7.2.0.alpha)
activemodel (= 7.2.0.alpha)
activerecord (= 7.2.0.alpha)
activestorage (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
bundler (>= 1.15.0)
railties (= 7.2.0.alpha)
railties (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)

PATH
remote: ../..
specs:
texd (0.6.0)
multipart-post (~> 2.0)
rails (>= 6.0, < 8)

GEM
remote: https://rubygems.org/
specs:
base64 (0.2.0)
bigdecimal (3.1.8)
builder (3.2.4)
byebug (11.1.3)
coderay (1.1.3)
combustion (1.4.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
thor (>= 0.14.6)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
crass (1.0.6)
date (3.3.4)
diff-lcs (1.5.1)
drb (2.2.1)
erubi (1.12.0)
globalid (1.2.1)
activesupport (>= 6.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.13.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.4)
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.21.2)
multipart-post (2.4.1)
net-imap (0.4.11)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.5-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.5-arm-linux)
racc (~> 1.4)
nokogiri (1.16.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86-linux)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
psych (5.1.2)
stringio
racc (1.7.3)
rack (3.0.11)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
rake (13.2.1)
rdoc (6.6.3.1)
psych (>= 4.0.0)
reline (0.5.7)
io-console (~> 0.5)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (6.1.2)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
rspec-core (~> 3.13)
rspec-expectations (~> 3.13)
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
stringio (3.1.0)
thor (1.3.1)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
useragent (0.16.10)
webrick (1.8.1)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.14)

PLATFORMS
aarch64-linux
arm-linux
arm64-darwin
x86-linux
x86_64-darwin
x86_64-linux

DEPENDENCIES
combustion
pry-byebug
rails!
rake (~> 13.0)
rspec (~> 3.0)
rspec-rails
texd!

BUNDLED WITH
2.5.6
Loading

0 comments on commit 13aad56

Please # to comment.