Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rails 7.0 to CI #183

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ jobs:
- setup_remote_docker
- run: docker-compose run --rm test-rails-6.1

test_rails_7_0:
docker:
- image: circleci/buildpack-deps
working_directory: ~/project/meta_request
steps:
- checkout:
path: ~/project
- setup_remote_docker
- run: docker-compose run --rm test-rails-7.0

workflows:
version: 2
test_all:
Expand All @@ -92,3 +102,4 @@ workflows:
- test_rails_5_2
- test_rails_6_0
- test_rails_6_1
- test_rails_7_0
19 changes: 11 additions & 8 deletions meta_request/Dockerfile-rails-4.2
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
FROM ruby:2.6-alpine

RUN apk add --update --no-cache \
build-base curl-dev git sqlite-dev \
yaml-dev zlib-dev nodejs yarn tzdata
build-base \
curl-dev \
git \
nodejs \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app
Expand All @@ -12,14 +19,10 @@ RUN rails new . --skip-spring

RUN bundle remove sqlite3
RUN bundle add sqlite3 --version '~> 1.3.6'
RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN bundle add meta_request
RUN bundle install --local
RUN echo 'gem "meta_request", path: "/gem"' >> Gemfile
RUN bundle install

COPY res/routes.rb /app/config/
COPY res/dummy_controller.rb /app/app/controllers/
Expand Down
21 changes: 12 additions & 9 deletions meta_request/Dockerfile-rails-5.0
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
FROM ruby:2.6-alpine

RUN apk add --update --no-cache \
build-base curl-dev git sqlite-dev \
yaml-dev zlib-dev nodejs yarn tzdata
build-base \
curl-dev \
git \
nodejs \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app

RUN gem update --system
RUN gem install rails -v 5.0.7.2
RUN rails new .

RUN bundle remove sqlite3
RUN bundle add sqlite3 --version '~> 1.3.6'
RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN bundle add meta_request
RUN bundle install --local
RUN bundle add meta_request --path /gem
RUN bundle install

COPY res/routes.rb /app/config/
COPY res/dummy_controller.rb /app/app/controllers/
Expand Down
21 changes: 12 additions & 9 deletions meta_request/Dockerfile-rails-5.1
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
FROM ruby:2.6-alpine

RUN apk add --update --no-cache \
build-base curl-dev git sqlite-dev \
yaml-dev zlib-dev nodejs yarn tzdata
build-base \
curl-dev \
git \
nodejs \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app

RUN gem update --system
RUN gem install rails -v 5.1.7
RUN rails new .

RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN bundle add meta_request
RUN bundle install --local
RUN bundle add meta_request --path /gem
RUN bundle install

COPY res/routes.rb /app/config/
COPY res/dummy_controller.rb /app/app/controllers/
Expand Down
22 changes: 13 additions & 9 deletions meta_request/Dockerfile-rails-5.2
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
FROM ruby:2.6-alpine

RUN apk add --update --no-cache \
build-base curl-dev git sqlite-dev \
yaml-dev zlib-dev nodejs yarn tzdata
build-base \
curl-dev \
git \
nodejs \
shared-mime-info \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app

RUN gem update --system
RUN gem install rails -v 5.2.3
RUN rails new .

RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN bundle add meta_request
RUN bundle install --local
RUN bundle add meta_request --path /gem
RUN bundle install

COPY res/routes.rb /app/config/
COPY res/dummy_controller.rb /app/app/controllers/
Expand Down
30 changes: 20 additions & 10 deletions meta_request/Dockerfile-rails-6.0
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
FROM ruby:2.6-alpine

RUN apk add --update --no-cache \
build-base curl-dev git sqlite-dev \
yaml-dev zlib-dev nodejs yarn tzdata
build-base \
curl-dev \
git \
nodejs \
shared-mime-info \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app

RUN gem install rails -v 6.0.0.rc2
RUN gem update --system
RUN gem install rails -v 6.0.6
RUN rails new .

RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN bundle add meta_request
RUN bundle install --local
RUN bundle add meta_request --path /gem
RUN bundle install

COPY res/routes.rb /app/config/
COPY res/dummy_controller.rb /app/app/controllers/
Expand All @@ -26,6 +30,12 @@ COPY res/meta_request_test.rb /app/test/integration/

RUN bundle exec rails db:migrate

# Webpacker 4 does not work well with Node v16
RUN bundle remove webpacker
RUN bundle add webpacker -v 5.4.3
RUN bundle install
RUN bundle exec rails webpacker:install

ENV PARALLEL_WORKERS 1

CMD ["bin/rake"]
24 changes: 14 additions & 10 deletions meta_request/Dockerfile-rails-6.1
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
FROM ruby:2.6-alpine

RUN apk add --update --no-cache \
build-base curl-dev git sqlite-dev \
yaml-dev zlib-dev nodejs yarn tzdata
build-base \
curl-dev \
git \
nodejs \
shared-mime-info \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app

RUN gem install rails -v 6.1.0
RUN gem update --system
RUN gem install rails -v 6.1.7
RUN rails new .

RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN bundle add meta_request
RUN bundle install --local
RUN bundle add meta_request --path /gem
RUN bundle install

COPY res/routes.rb /app/config/
COPY res/dummy_controller.rb /app/app/controllers/
Expand Down
35 changes: 35 additions & 0 deletions meta_request/Dockerfile-rails-7.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM ruby:3.0-alpine

RUN apk add --update --no-cache \
build-base \
curl-dev \
git \
nodejs \
shared-mime-info \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app

RUN gem update --system
RUN gem install rails -v 7.0.4
RUN rails new .

COPY . /gem
RUN bundle add meta_request --path /gem
RUN bundle install

COPY res/routes.rb /app/config/
COPY res/dummy_controller.rb /app/app/controllers/
COPY res/dummy /app/app/views/dummy
COPY res/meta_request_test.rb /app/test/integration/

RUN bundle exec rails db:migrate

ENV PARALLEL_WORKERS 1

CMD ["bin/rake"]
4 changes: 4 additions & 0 deletions meta_request/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ services:
build:
context: .
dockerfile: Dockerfile-rails-6.1
test-rails-7.0:
build:
context: .
dockerfile: Dockerfile-rails-7.0
2 changes: 1 addition & 1 deletion meta_request/meta_request.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
gem.license = 'MIT'

gem.add_dependency 'rack-contrib', '>= 1.1', '< 3'
gem.add_dependency 'railties', '>= 3.0.0', '< 7'
gem.add_dependency 'railties', '>= 3.0.0', '< 7.1'
gem.add_development_dependency 'rspec', '~> 3.8.0'
gem.add_development_dependency 'rubocop', '~> 0.74.0'

Expand Down
2 changes: 1 addition & 1 deletion meta_request/res/meta_request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def cleanup
@request_id = response.headers['X-Request-Id']
end

test 'it shold have a request_id header' do
test 'it should have a request_id header' do
assert @request_id
end

Expand Down