-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test (almost) all gems against their latest commit
- Loading branch information
Showing
4 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require "bundler" | ||
|
||
remote = "https://rubygems.org" | ||
fetcher = Bundler::Fetcher.new(Bundler::Source::Rubygems::Remote.new(remote)) | ||
dsl = Bundler::Dsl.evaluate("#{__dir__}/../Gemfile", "#{__dir__}/../Gemfile.lock", {}) | ||
stubs = dsl.resolve.materialize(dsl.dependencies_for(%w[default test])).map do |stub| | ||
Bundler::RemoteSpecification.new(stub.name, stub.version, stub.platform, fetcher) | ||
end | ||
|
||
lines = ["source #{remote.inspect}"] | ||
NO_GIT = %w[minitest i18n logger simplecov].freeze | ||
FULL_SKIP = %w[simplecov-html nokogiri mini_portile2].freeze | ||
|
||
stubs.each do |stub| | ||
url = stub.metadata["source_code_uri"] || stub.homepage | ||
matched = url[%r{https?://git(?:hub|lab)\.com/[^\/]*/[^\/]*}] | ||
next if FULL_SKIP.include?(stub.name) | ||
|
||
lines << if matched && !NO_GIT.include?(stub.name) # rubocop:disable Rails/NegateInclude | ||
"gem #{stub.name.inspect}, git: #{matched.inspect}, submodules: true" | ||
else | ||
"gem #{stub.name.inspect}" | ||
end | ||
end | ||
|
||
File.write("Gemfile", lines.join("\n")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
FROM ruby:3.3.4-alpine3.20 AS ruby-builder | ||
ARG BASE_IMAGE | ||
FROM ${BASE_IMAGE:-ruby:3.3.4-alpine3.20} AS ruby-builder | ||
|
||
RUN apk --no-cache add build-base cmake postgresql16-dev | ||
RUN apk --no-cache add build-base cmake postgresql16-dev git | ||
|
||
COPY Gemfile Gemfile.lock ./ | ||
RUN gem i foreman && bundle install \ | ||
|
@@ -12,7 +13,7 @@ FROM node:20-alpine3.20 AS node-downloader | |
|
||
RUN npm install [email protected] -g | ||
|
||
FROM ruby:3.3.4-alpine3.20 | ||
FROM ${BASE_IMAGE:-ruby:3.3.4-alpine3.20} | ||
|
||
WORKDIR /app | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters