Skip to content

Commit

Permalink
Add CI on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
marcogregorius committed Nov 21, 2022
1 parent 56f39b2 commit 4de53a2
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 45 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -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 '\''<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
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
8 changes: 0 additions & 8 deletions gemfiles/rails-4-0.gemfile

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/rails-4-1.gemfile

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/rails-4-2.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails-5-0.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails-5-1.gemfile

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/rails-5-2.gemfile

This file was deleted.

8 changes: 8 additions & 0 deletions gemfiles/rails-6-0.gemfile
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 => "../"
9 changes: 9 additions & 0 deletions gemfiles/rails-6-1.gemfile
Original file line number Diff line number Diff line change
@@ -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 => "../"
8 changes: 8 additions & 0 deletions gemfiles/rails-7-0.gemfile
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 => "../"

0 comments on commit 4de53a2

Please sign in to comment.