diff --git a/.circleci/config.yml b/.circleci/config.yml index a5cc92e..7f5fb77 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -92,3 +102,4 @@ workflows: - test_rails_5_2 - test_rails_6_0 - test_rails_6_1 + - test_rails_7_0 diff --git a/meta_request/Dockerfile-rails-4.2 b/meta_request/Dockerfile-rails-4.2 index c748736..eb35e86 100644 --- a/meta_request/Dockerfile-rails-4.2 +++ b/meta_request/Dockerfile-rails-4.2 @@ -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 @@ -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/ diff --git a/meta_request/Dockerfile-rails-5.0 b/meta_request/Dockerfile-rails-5.0 index ac498a9..63abdc7 100644 --- a/meta_request/Dockerfile-rails-5.0 +++ b/meta_request/Dockerfile-rails-5.0 @@ -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/ diff --git a/meta_request/Dockerfile-rails-5.1 b/meta_request/Dockerfile-rails-5.1 index 755b0e5..ac1ec9b 100644 --- a/meta_request/Dockerfile-rails-5.1 +++ b/meta_request/Dockerfile-rails-5.1 @@ -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/ diff --git a/meta_request/Dockerfile-rails-5.2 b/meta_request/Dockerfile-rails-5.2 index 49a5b3d..3814ea0 100644 --- a/meta_request/Dockerfile-rails-5.2 +++ b/meta_request/Dockerfile-rails-5.2 @@ -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/ diff --git a/meta_request/Dockerfile-rails-6.0 b/meta_request/Dockerfile-rails-6.0 index 11809f7..5205b8c 100644 --- a/meta_request/Dockerfile-rails-6.0 +++ b/meta_request/Dockerfile-rails-6.0 @@ -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/ @@ -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"] diff --git a/meta_request/Dockerfile-rails-6.1 b/meta_request/Dockerfile-rails-6.1 index 9f1554e..7475cef 100644 --- a/meta_request/Dockerfile-rails-6.1 +++ b/meta_request/Dockerfile-rails-6.1 @@ -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/ diff --git a/meta_request/Dockerfile-rails-7.0 b/meta_request/Dockerfile-rails-7.0 new file mode 100644 index 0000000..864d42a --- /dev/null +++ b/meta_request/Dockerfile-rails-7.0 @@ -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"] diff --git a/meta_request/docker-compose.yml b/meta_request/docker-compose.yml index 10bc7cd..5d12dd8 100644 --- a/meta_request/docker-compose.yml +++ b/meta_request/docker-compose.yml @@ -29,3 +29,7 @@ services: build: context: . dockerfile: Dockerfile-rails-6.1 + test-rails-7.0: + build: + context: . + dockerfile: Dockerfile-rails-7.0 diff --git a/meta_request/meta_request.gemspec b/meta_request/meta_request.gemspec index 298204f..24ba44c 100644 --- a/meta_request/meta_request.gemspec +++ b/meta_request/meta_request.gemspec @@ -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' diff --git a/meta_request/res/meta_request_test.rb b/meta_request/res/meta_request_test.rb index 9a020e2..6216e62 100644 --- a/meta_request/res/meta_request_test.rb +++ b/meta_request/res/meta_request_test.rb @@ -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