diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 000000000..a26f346fc --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,63 @@ +name: Test + +on: [push, pull_request] + +jobs: + test: + name: RSpec and Cucumber + strategy: + fail-fast: false + matrix: + ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1', jruby ] + gemfile: [ gemfiles/rails-6-1.gemfile ] + experimental: [ false ] + include: + - ruby: '3.0' + gemfile: gemfiles/rails-6-0.gemfile + experimental: false + - ruby: '3.0' + gemfile: gemfiles/rails-7-0.gemfile + experimental: false + - ruby: '3.1' + gemfile: gemfiles/rails-master.gemfile + experimental: false + - ruby: ruby-head + gemfile: gemfiles/rails-7-0.gemfile + experimental: false + - ruby: jruby-head + gemfile: gemfiles/rails-6-1.gemfile + experimental: true + runs-on: ubuntu-20.04 + services: + postgres: + image: postgres:11 + ports: + - 5432:5432 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: carrierwave_test + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + 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 '\'''\'' > /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 + 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 diff --git a/gemfiles/rails-4-0.gemfile b/gemfiles/rails-4-0.gemfile deleted file mode 100644 index fec1290e2..000000000 --- a/gemfiles/rails-4-0.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -source "https://rubygems.org" - -gem "rails", "~> 4.0.0" -gem "railties", "~> 4.0.0" -gem 'pg', '~> 0.21.0', platforms: :ruby -gem "activerecord-jdbcpostgresql-adapter", "~> 1.3", platforms: :jruby - -gemspec :path => "../" diff --git a/gemfiles/rails-4-1.gemfile b/gemfiles/rails-4-1.gemfile deleted file mode 100644 index 2bec01cea..000000000 --- a/gemfiles/rails-4-1.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -source "https://rubygems.org" - -gem "rails", "~> 4.1.0" -gem 'pg', '~> 0.21.0', platforms: :ruby -gem "activerecord-jdbcpostgresql-adapter", "~> 1.3", platforms: :jruby - -gemspec :path => "../" diff --git a/gemfiles/rails-4-2.gemfile b/gemfiles/rails-4-2.gemfile deleted file mode 100644 index 476335f54..000000000 --- a/gemfiles/rails-4-2.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -source "https://rubygems.org" - -gem "rails", "~> 4.2.0" -gem 'pg', '~> 0.21.0', platforms: :ruby -gem "activerecord-jdbcpostgresql-adapter", "~> 1.3", platforms: :jruby - -gemspec :path => "../" diff --git a/gemfiles/rails-5-0.gemfile b/gemfiles/rails-5-0.gemfile deleted file mode 100644 index c8763593a..000000000 --- a/gemfiles/rails-5-0.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -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 - -gemspec :path => "../" diff --git a/gemfiles/rails-5-1.gemfile b/gemfiles/rails-5-1.gemfile deleted file mode 100644 index 64e6932cf..000000000 --- a/gemfiles/rails-5-1.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -source "https://rubygems.org" - -gem "rails", "~> 5.1.0" -gem "activemodel-serializers-xml" -gem 'pg', '~> 0.21.0', platforms: :ruby -gem "activerecord-jdbcpostgresql-adapter", '~> 51.0', platforms: :jruby - -gemspec :path => "../" diff --git a/gemfiles/rails-5-2.gemfile b/gemfiles/rails-5-2.gemfile deleted file mode 100644 index e8c0aa564..000000000 --- a/gemfiles/rails-5-2.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -source "https://rubygems.org" - -gem "rails", "~> 5.2.0" -gem "activemodel-serializers-xml" -gem 'pg', '~> 0.21.0', platforms: :ruby - -gemspec :path => "../" diff --git a/gemfiles/rails-6-0.gemfile b/gemfiles/rails-6-0.gemfile new file mode 100644 index 000000000..3ad07691b --- /dev/null +++ b/gemfiles/rails-6-0.gemfile @@ -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 => "../" diff --git a/gemfiles/rails-6-1.gemfile b/gemfiles/rails-6-1.gemfile new file mode 100644 index 000000000..dd2411f88 --- /dev/null +++ b/gemfiles/rails-6-1.gemfile @@ -0,0 +1,9 @@ +source "https://rubygems.org" + +gem "rails", "~> 6.1.0" +gem "activemodel-serializers-xml" +gem 'sqlite3', platforms: :ruby +gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] +gem "fog-google", "~> 1.13.0" if RUBY_VERSION < '2.7' + +gemspec :path => "../" diff --git a/gemfiles/rails-7-0.gemfile b/gemfiles/rails-7-0.gemfile new file mode 100644 index 000000000..6dee328c3 --- /dev/null +++ b/gemfiles/rails-7-0.gemfile @@ -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 => "../"