Skip to content

Commit

Permalink
Support any Rails branch in CI (#1172)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanharan authored May 14, 2024
1 parent ae733fd commit 21cf471
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ WORKDIR $WORKDIR

COPY . $WORKDIR

RUN RAILS_MAIN=1 bundle install --jobs `expr $(cat /proc/cpuinfo | grep -c "cpu cores") - 1` --retry 3
RUN RAILS_BRANCH=7-2-stable bundle install --jobs `expr $(cat /proc/cpuinfo | grep -c "cpu cores") - 1` --retry 3

CMD ["sh"]
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ gem "msgpack", ">= 1.7.0"

if ENV["RAILS_SOURCE"]
gemspec path: ENV["RAILS_SOURCE"]
elsif ENV["RAILS_MAIN"]
gem "rails", github: "rails/rails", branch: 'main'
elsif ENV["RAILS_BRANCH"]
gem "rails", github: "rails/rails", branch: ENV["RAILS_BRANCH"]
else
# Need to get rails source because the gem doesn't include tests
version = ENV["RAILS_VERSION"] || begin
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
ci:
environment:
- ACTIVERECORD_UNITTEST_HOST=sqlserver
- RAILS_MAIN=1
- RAILS_BRANCH=7-2-stable
build:
context: .
dockerfile: Dockerfile.ci
Expand Down

0 comments on commit 21cf471

Please sign in to comment.