Move from Travis to GitHub Actions

This commit is contained in:
Carlos Antonio da Silva 2021-01-29 16:56:28 -03:00
parent 81bf3ad8c1
commit 7e6da424e2
3 changed files with 99 additions and 112 deletions

98
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,98 @@
name: Test
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
gemfile:
- Gemfile
- gemfiles/Gemfile.rails-6.0-stable
- gemfiles/Gemfile.rails-5.2-stable
- gemfiles/Gemfile.rails-5.1-stable
- gemfiles/Gemfile.rails-5.0-stable
- gemfiles/Gemfile.rails-4.2-stable
- gemfiles/Gemfile.rails-4.1-stable
ruby:
- 2.1.10
- 2.2.10
- 2.3.8
- 2.4.10
- 2.5.8
- 2.6.6
- 2.7.1
- ruby-head
env:
- DEVISE_ORM=active_record
- DEVISE_ORM=mongoid
exclude:
- ruby: 2.1.10
gemfile: Gemfile
- ruby: 2.1.10
gemfile: gemfiles/Gemfile.rails-6.0-stable
- ruby: 2.1.10
gemfile: gemfiles/Gemfile.rails-5.2-stable
- ruby: 2.1.10
gemfile: gemfiles/Gemfile.rails-5.1-stable
- ruby: 2.1.10
gemfile: gemfiles/Gemfile.rails-5.0-stable
- ruby: 2.2.10
gemfile: Gemfile
- ruby: 2.2.10
gemfile: gemfiles/Gemfile.rails-6.0-stable
- ruby: 2.2.10
gemfile: gemfiles/Gemfile.rails-5.2-stable
- ruby: 2.3.8
gemfile: Gemfile
- ruby: 2.3.8
gemfile: gemfiles/Gemfile.rails-6.0-stable
- ruby: 2.4.10
gemfile: Gemfile
- ruby: 2.4.10
gemfile: gemfiles/Gemfile.rails-6.0-stable
- ruby: 2.4.10
gemfile: gemfiles/Gemfile.rails-4.1-stable
- ruby: 2.5.8
gemfile: gemfiles/Gemfile.rails-4.1-stable
- ruby: 2.6.6
gemfile: gemfiles/Gemfile.rails-4.1-stable
- ruby: 2.6.6
gemfile: gemfiles/Gemfile.rails-4.2-stable
- ruby: 2.7.1
gemfile: gemfiles/Gemfile.rails-4.1-stable
- ruby: 2.7.1
gemfile: gemfiles/Gemfile.rails-4.1-stable
- ruby: 2.7.1
gemfile: gemfiles/Gemfile.rails-4.2-stable
- ruby: 2.7.1
gemfile: gemfiles/Gemfile.rails-5.0-stable
- ruby: 2.7.1
gemfile: gemfiles/Gemfile.rails-5.1-stable
- ruby: 2.7.1
gemfile: gemfiles/Gemfile.rails-5.2-stable
- ruby: ruby-head
gemfile: gemfiles/Gemfile.rails-4.1-stable
- ruby: ruby-head
gemfile: gemfiles/Gemfile.rails-4.2-stable
- env: DEVISE_ORM=mongoid
gemfile: Gemfile
- env: DEVISE_ORM=mongoid
gemfile: gemfiles/Gemfile.rails-5.0-stable
- env: DEVISE_ORM=mongoid
gemfile: gemfiles/Gemfile.rails-5.1-stable
- env: DEVISE_ORM=mongoid
gemfile: gemfiles/Gemfile.rails-5.2-stable
- env: DEVISE_ORM=mongoid
gemfile: gemfiles/Gemfile.rails-6.0-stable
runs-on: ubuntu-latest
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs bundle install and caches installed gems automatically
- uses: supercharge/mongodb-github-action@1.3.0
if: ${{ matrix.env == 'DEVISE_ORM=mongoid' }}
- run: bundle exec rake

View File

@ -1,110 +0,0 @@
language: ruby
rvm:
- 2.1.10
- 2.2.10
- 2.3.8
- 2.4.10
- 2.5.8
- 2.6.6
- 2.7.1
- ruby-head
gemfile:
- Gemfile
- gemfiles/Gemfile.rails-6.0-stable
- gemfiles/Gemfile.rails-5.2-stable
- gemfiles/Gemfile.rails-5.1-stable
- gemfiles/Gemfile.rails-5.0-stable
- gemfiles/Gemfile.rails-4.2-stable
- gemfiles/Gemfile.rails-4.1-stable
matrix:
exclude:
- rvm: 2.1.10
gemfile: Gemfile
- rvm: 2.1.10
gemfile: gemfiles/Gemfile.rails-6.0-stable
- rvm: 2.1.10
gemfile: gemfiles/Gemfile.rails-5.2-stable
- rvm: 2.1.10
gemfile: gemfiles/Gemfile.rails-5.1-stable
- rvm: 2.1.10
gemfile: gemfiles/Gemfile.rails-5.0-stable
- rvm: 2.2.10
gemfile: Gemfile
- rvm: 2.2.10
gemfile: gemfiles/Gemfile.rails-6.0-stable
- rvm: 2.2.10
gemfile: gemfiles/Gemfile.rails-5.2-stable
- rvm: 2.3.8
gemfile: Gemfile
- rvm: 2.3.8
gemfile: gemfiles/Gemfile.rails-6.0-stable
- rvm: 2.4.10
gemfile: Gemfile
- rvm: 2.4.10
gemfile: gemfiles/Gemfile.rails-6.0-stable
- rvm: 2.4.10
gemfile: gemfiles/Gemfile.rails-4.1-stable
- rvm: 2.5.8
gemfile: gemfiles/Gemfile.rails-4.1-stable
- rvm: 2.6.6
gemfile: gemfiles/Gemfile.rails-4.1-stable
- rvm: 2.6.6
gemfile: gemfiles/Gemfile.rails-4.2-stable
- rvm: 2.7.1
gemfile: gemfiles/Gemfile.rails-4.1-stable
- rvm: 2.7.1
gemfile: gemfiles/Gemfile.rails-4.1-stable
- rvm: 2.7.1
gemfile: gemfiles/Gemfile.rails-4.2-stable
- rvm: 2.7.1
gemfile: gemfiles/Gemfile.rails-5.0-stable
- rvm: 2.7.1
gemfile: gemfiles/Gemfile.rails-5.1-stable
- rvm: 2.7.1
gemfile: gemfiles/Gemfile.rails-5.2-stable
- rvm: ruby-head
gemfile: gemfiles/Gemfile.rails-4.1-stable
- rvm: ruby-head
gemfile: gemfiles/Gemfile.rails-4.2-stable
- env: DEVISE_ORM=mongoid
gemfile: Gemfile
- env: DEVISE_ORM=mongoid
gemfile: gemfiles/Gemfile.rails-5.0-stable
- env: DEVISE_ORM=mongoid
gemfile: gemfiles/Gemfile.rails-5.1-stable
- env: DEVISE_ORM=mongoid
gemfile: gemfiles/Gemfile.rails-5.2-stable
- env: DEVISE_ORM=mongoid
gemfile: gemfiles/Gemfile.rails-6.0-stable
allow_failures:
- rvm: ruby-head
services:
- mongodb
cache: bundler
env:
matrix:
- DEVISE_ORM=active_record
- DEVISE_ORM=mongoid
before_install:
- gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
- gem install bundler -v '< 2'
- "rm ${BUNDLE_GEMFILE}.lock"
before_script: "bundle update"
script: "bin/test"
notifications:
email: false
slack:
on_pull_requests: false
on_success: change
on_failure: always
secure: Q3M+kmude3FjisibEeeGe0wSMXgvwLH+vL7Zrx9//q4QtkfnrQ/BBMvY9KXxPEsNF+eys4YopYjTkJ8uRmeboUATW/oQ4Jrv3+u3zkIHK2sFn/Q2cQWpK5w+CbgEnHPjKYnUu34b09njXTgDlr/mqtbPqrKeZ1dLlpKXCB/q4GY=

View File

@ -1,6 +1,5 @@
![Devise Logo](https://raw.github.com/heartcombo/devise/master/devise.png) ![Devise Logo](https://raw.github.com/heartcombo/devise/master/devise.png)
[![Build Status](https://api.travis-ci.org/heartcombo/devise.svg?branch=master)](http://travis-ci.org/heartcombo/devise)
[![Code Climate](https://codeclimate.com/github/heartcombo/devise.svg)](https://codeclimate.com/github/heartcombo/devise) [![Code Climate](https://codeclimate.com/github/heartcombo/devise.svg)](https://codeclimate.com/github/heartcombo/devise)
Devise is a flexible authentication solution for Rails based on Warden. It: Devise is a flexible authentication solution for Rails based on Warden. It:
@ -131,7 +130,7 @@ Please note that the command output will show the variable value being used.
### BUNDLE_GEMFILE ### BUNDLE_GEMFILE
We can use this variable to tell bundler what Gemfile it should use (instead of the one in the current directory). We can use this variable to tell bundler what Gemfile it should use (instead of the one in the current directory).
Inside the [gemfiles](https://github.com/heartcombo/devise/tree/master/gemfiles) directory, we have one for each version of Rails we support. When you send us a pull request, it may happen that the test suite breaks on Travis using some of them. If that's the case, you can simulate the same environment using the `BUNDLE_GEMFILE` variable. Inside the [gemfiles](https://github.com/heartcombo/devise/tree/master/gemfiles) directory, we have one for each version of Rails we support. When you send us a pull request, it may happen that the test suite breaks using some of them. If that's the case, you can simulate the same environment using the `BUNDLE_GEMFILE` variable.
For example, if the tests broke using Ruby 2.4.2 and Rails 4.1, you can do the following: For example, if the tests broke using Ruby 2.4.2 and Rails 4.1, you can do the following:
```bash ```bash
rbenv shell 2.4.2 # or rvm use 2.4.2 rbenv shell 2.4.2 # or rvm use 2.4.2