diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..34885aae --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + tests: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + ruby: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0] + gemfile: [rails_4_2, rails_5_0, rails_5_1, rails_5_2, rails_6_0, rails_6_1] + exclude: + + # Rails 6.0 requires Ruby 2.5 and above. + - gemfile: rails_6_0 + ruby: 2.3 + - gemfile: rails_6_0 + ruby: 2.4 + + # Rails 6.1 requires Ruby 2.5 and above. + - gemfile: rails_6_1 + ruby: 2.3 + - gemfile: rails_6_1 + ruby: 2.4 + + # Rails supports Ruby 3.0 since 6.0 only. So skip all the other Rails versions. + - ruby: 3.0 + gemfile: rails_4_2 + - ruby: 3.0 + gemfile: rails_5_0 + - ruby: 3.0 + gemfile: rails_5_1 + - ruby: 3.0 + gemfile: rails_5_2 + + name: ${{ matrix.gemfile }}, Ruby ${{ matrix.ruby }} + + steps: + - uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: false + + - name: Bundle install + run: | + bundle config set gemfile "${GITHUB_WORKSPACE}/gemfiles/${{ matrix.gemfile }}.gemfile" + bundle install --jobs 4 --retry 3 + + - name: Start dynamodb-local + run: | + docker-compose up -d + + - name: Run RSpec tests + run: | + bundle exec rspec + + - name: Stop dynamodb-local + run: | + docker-compose down diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6fd59360..00000000 --- a/.travis.yml +++ /dev/null @@ -1,70 +0,0 @@ -sudo: required - -language: ruby -rvm: - - ruby-2.3.8 - - ruby-2.4.6 - - ruby-2.5.5 - - ruby-2.6.3 - - ruby-2.7.0 - - ruby-3.0.0 - - jruby-9.2.14.0 -gemfile: - - gemfiles/rails_4_2.gemfile - - gemfiles/rails_5_0.gemfile - - gemfiles/rails_5_1.gemfile - - gemfiles/rails_5_2.gemfile - - gemfiles/rails_6_0.gemfile - - gemfiles/rails_6_1.gemfile - -# https://docs.travis-ci.com/user/build-matrix -matrix: - exclude: - - # Rails 6.0 requires Ruby 2.5 and above - - rvm: ruby-2.3.8 - gemfile: gemfiles/rails_6_0.gemfile - - rvm: ruby-2.4.6 - gemfile: gemfiles/rails_6_0.gemfile - - # Rails 6.1 requires Ruby 2.5 and above - - rvm: ruby-2.3.8 - gemfile: gemfiles/rails_6_1.gemfile - - rvm: ruby-2.4.6 - gemfile: gemfiles/rails_6_1.gemfile - - # Rails supports Ruby 3 since 6.0 only so skip all the other versions - - rvm: ruby-3.0.0 - gemfile: gemfiles/rails_4_2.gemfile - - rvm: ruby-3.0.0 - gemfile: gemfiles/rails_5_0.gemfile - - rvm: ruby-3.0.0 - gemfile: gemfiles/rails_5_1.gemfile - - rvm: ruby-3.0.0 - gemfile: gemfiles/rails_5_2.gemfile - - -### BUILD LIFECYCLE STEPS ### - -before_install: - # Debugging: Print out the current docker-compose version. - - docker-compose --version - - # If one of your containers does not build for - # whatever reason it's best to report that now before your tests start - # otherwise it can be really tricky to debug why tests are failing sometimes. - - docker ps - -after_install: - - gem install bundler -v 1.16.2 - - bundle install - -before_script: - # Start Docker Compose as a daemon - - docker-compose up -d - -script: - - bundle exec rake spec - -after_script: - - docker-compose down diff --git a/README.md b/README.md index 0dc35cf5..677f31c1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dynamoid -[![Build Status](https://travis-ci.org/Dynamoid/dynamoid.svg?branch=master)](https://travis-ci.org/Dynamoid/dynamoid) +[![Build Status](https://github.com/Dynamoid/dynamoid/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Dynamoid/dynamoid/actions/workflows/ci.yml/badge.svg?branch=master) [![Code Climate](https://codeclimate.com/github/Dynamoid/dynamoid.svg)](https://codeclimate.com/github/Dynamoid/dynamoid) [![Coverage Status](https://coveralls.io/repos/github/Dynamoid/dynamoid/badge.svg?branch=master)](https://coveralls.io/github/Dynamoid/dynamoid?branch=master) [![CodeTriage Helpers](https://www.codetriage.com/dynamoid/dynamoid/badges/users.svg)](https://www.codetriage.com/dynamoid/dynamoid)