Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2640 from marcogregorius/add-ci
Add CI on GitHub for 1.x-stable branch
- Loading branch information
Showing
18 changed files
with
179 additions
and
60 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,79 @@ | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: RSpec and Cucumber | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: [ '2.2', '2.3', '2.4', '2.5', '2.6' ] | ||
gemfile: | ||
- gemfiles/rails-4-0.gemfile | ||
- gemfiles/rails-4-1.gemfile | ||
- gemfiles/rails-4-2.gemfile | ||
- gemfiles/rails-5-0.gemfile | ||
- gemfiles/rails-5-1.gemfile | ||
- gemfiles/rails-5-2.gemfile | ||
experimental: [ false ] | ||
include: | ||
- ruby: '2.7' | ||
gemfile: gemfiles/rails-6-1.gemfile | ||
experimental: false | ||
- ruby: '3.0' | ||
gemfile: gemfiles/rails-6-1.gemfile | ||
experimental: false | ||
- ruby: '3.0' | ||
gemfile: gemfiles/rails-7-0.gemfile | ||
experimental: false | ||
- ruby: '3.1' | ||
gemfile: gemfiles/rails-main.gemfile | ||
experimental: false | ||
exclude: | ||
- ruby: '2.4' | ||
gemfile: gemfiles/rails-4-0.gemfile | ||
- ruby: '2.4' | ||
gemfile: gemfiles/rails-4-1.gemfile | ||
- ruby: '2.5' | ||
gemfile: gemfiles/rails-4-0.gemfile | ||
- ruby: '2.5' | ||
gemfile: gemfiles/rails-4-1.gemfile | ||
- ruby: '2.6' | ||
gemfile: gemfiles/rails-4-0.gemfile | ||
- ruby: '2.6' | ||
gemfile: gemfiles/rails-4-1.gemfile | ||
- ruby: '2.6' | ||
gemfile: gemfiles/rails-4-2.gemfile | ||
runs-on: ubuntu-20.04 | ||
env: | ||
BUNDLE_GEMFILE: ${{ matrix.gemfile }} | ||
EXPERIMENTAL: ${{ matrix.experimental }} | ||
JRUBY_OPTS: --debug | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup ImageMagick policy | ||
run: sudo sh -c 'echo '\''<policymap><policy domain="coder" rights="read|write" pattern="PDF" /></policymap>'\'' > /etc/ImageMagick-6/policy.xml' | ||
- name: Update package list | ||
run: sudo apt update | ||
- name: Install ghostscript to process PDF | ||
run: sudo apt-get -y install ghostscript | ||
- name: Install libvips-dev for Carrierwave::Vips | ||
run: sudo apt-get install libvips-dev | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
if: ${{ matrix.ruby <= 2.6 }} | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
bundler: 1.17.3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
if: ${{ matrix.ruby > 2.6 }} | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
- name: Run RSpec | ||
run: bundle exec rake spec || [ "$EXPERIMENTAL" == "true" ] && true | ||
- name: Run Cucumber | ||
run: bundle exec rake features || [ "$EXPERIMENTAL" == "true" ] && true |
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 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "activemodel-serializers-xml" | ||
gem 'pg', '~> 0.21.0', platforms: :ruby | ||
gem 'sqlite3', platforms: :ruby | ||
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] | ||
|
||
gemspec |
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
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,7 +1,7 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "rails", "~> 4.1.0" | ||
gem 'pg', '~> 0.21.0', platforms: :ruby | ||
gem "activerecord-jdbcpostgresql-adapter", "~> 1.3", platforms: :jruby | ||
gem 'sqlite3', '~> 1.3.6', platforms: :ruby | ||
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] | ||
|
||
gemspec :path => "../" |
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,7 +1,7 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "rails", "~> 4.2.0" | ||
gem 'pg', '~> 0.21.0', platforms: :ruby | ||
gem "activerecord-jdbcpostgresql-adapter", "~> 1.3", platforms: :jruby | ||
gem 'sqlite3', '~> 1.3.6', platforms: :ruby | ||
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] | ||
|
||
gemspec :path => "../" |
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,8 +1,11 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "rails", "~> 5.0.0" | ||
gem 'pg', '~> 0.21.0', platforms: :ruby | ||
gem "activemodel-serializers-xml" | ||
gem "activerecord-jdbcpostgresql-adapter", "~> 50.0", platforms: :jruby | ||
if RUBY_VERSION < '2.3' | ||
gem "ruby-vips", "2.0.13" | ||
end | ||
gem 'sqlite3', '~> 1.3.6', platforms: :ruby | ||
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] | ||
|
||
gemspec :path => "../" |
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
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,8 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "rails", "~> 6.0.0" | ||
gem "activemodel-serializers-xml" | ||
gem 'sqlite3', platforms: :ruby | ||
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] | ||
|
||
gemspec :path => "../" |
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,8 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "rails", "~> 6.1.0" | ||
gem "activemodel-serializers-xml" | ||
gem 'sqlite3', platforms: :ruby | ||
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] | ||
|
||
gemspec :path => "../" |
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,8 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "rails", "~> 7.0.0" | ||
gem "activemodel-serializers-xml" | ||
gem 'sqlite3', platforms: :ruby | ||
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] | ||
|
||
gemspec :path => "../" |
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,8 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "rails", github: "rails/rails", branch: "main" | ||
gem "activemodel-serializers-xml" | ||
gem 'sqlite3', platforms: :ruby | ||
gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] | ||
|
||
gemspec :path => "../" |
This file was deleted.
Oops, something went wrong.
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,31 +1,44 @@ | ||
if RUBY_ENGINE == 'jruby' | ||
require 'activerecord-jdbcpostgresql-adapter' | ||
else | ||
require 'pg' | ||
end | ||
require 'active_record' | ||
require 'carrierwave/orm/activerecord' | ||
Bundler.require | ||
|
||
# Change this if PG is unavailable | ||
dbconfig = { | ||
:adapter => 'postgresql', | ||
:database => 'carrierwave_test', | ||
:encoding => 'utf8', | ||
:username => 'postgres' | ||
} | ||
ActiveRecord::Base.establish_connection({ adapter: 'sqlite3', database: ':memory:' }) | ||
|
||
database = dbconfig.delete(:database) | ||
ActiveRecord::Migration.verbose = false | ||
|
||
ActiveRecord::Base.establish_connection(dbconfig.merge(database: "template1")) | ||
begin | ||
ActiveRecord::Base.connection.create_database database | ||
rescue ActiveRecord::StatementInvalid => e # database already exists | ||
end | ||
ActiveRecord::Base.establish_connection(dbconfig.merge(:database => database)) | ||
if ActiveRecord.version < Gem::Version.new("5.2") && ActiveRecord.version >= Gem::Version.new("5.0") | ||
module ActiveRecord | ||
module Type | ||
class Json < ActiveModel::Type::Value | ||
include ActiveModel::Type::Helpers::Mutable | ||
|
||
ActiveRecord::Migration.verbose = false | ||
def type | ||
:json | ||
end | ||
|
||
def deserialize(value) | ||
return value unless value.is_a?(::String) | ||
ActiveSupport::JSON.decode(value) rescue nil | ||
end | ||
|
||
def serialize(value) | ||
ActiveSupport::JSON.encode(value) unless value.nil? | ||
end | ||
|
||
def changed_in_place?(raw_old_value, new_value) | ||
deserialize(raw_old_value) != new_value | ||
end | ||
|
||
def accessor | ||
ActiveRecord::Store::StringKeyedHashAccessor | ||
end | ||
end | ||
end | ||
end | ||
|
||
ActiveRecord::Type.register(:json, ActiveRecord::Type::Json, override: false) | ||
end | ||
|
||
if ActiveRecord::VERSION::STRING >= '4.2' && ActiveRecord::VERSION::STRING < '5.0' | ||
ActiveRecord::Base.raise_in_transactional_callbacks = true | ||
ActiveRecord::Base.raise_in_transactional_callbacks = true | ||
end |
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