Skip to content

Commit

Permalink
Setup build matrix in CI (#116)
Browse files Browse the repository at this point in the history
* allow GET requests in specs

This is not something anyone should do in production. But in tests, this
allows us to bypass CSRF.

* remove Gemfile.lock

So we're not constrained on a specific bundler version.

Also, Gemfile.lock won't be used when this gem is added as a dependency
anyway. If we require a specific version, it should be set in the
gemspec file.

* relax bundler version

1.9 is already pretty old. There's no reason not to be able to run a
  newer version

* setup ruby versions matrix

* upgrade listen

So it runs a version supported by ruby 3.0

* test ruby 3.0
  • Loading branch information
dmathieu authored Jan 15, 2021
1 parent b4e5eef commit 68f0d52
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 175 deletions.
32 changes: 27 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
version: 2.1
matrix_rubyversions: &matrix_rubyversions
matrix:
parameters:
rubyversion: ["2.5", "2.6", "2.7", "3.0"]
# Default version of ruby to use for lint and publishing
default_rubyversion: &default_rubyversion "2.7"

executors:
ruby:
parameters:
rubyversion:
type: string
default: *default_rubyversion
docker:
- image: circleci/ruby:<< parameters.rubyversion >>

jobs:
run-tests:
docker:
- image: circleci/ruby:2.5.7-buster
parameters:
rubyversion:
type: string
default: *default_rubyversion
executor:
name: ruby
rubyversion: "<< parameters.rubyversion >>"
steps:
- checkout
- restore_cache:
keys:
- gems-v2-{{ checksum "Gemfile.lock" }}
- gems-v2-{{ checksum "Gemfile" }}
- gems-v2-
- run: bundle check || bundle install
- save_cache:
key: gems-v2--{{ checksum "Gemfile.lock" }}
key: gems-v2--{{ checksum "Gemfile" }}
paths:
- vendor/bundle
- run: bundle exec rake spec

workflows:
tests:
jobs:
- run-tests
- run-tests:
<<: *matrix_rubyversions
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ tmp/
## Environment normalization:
/.bundle
/vendor/bundle

Gemfile.lock
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end

group :test do
gem 'guard-rspec', require: false
gem 'listen', '~> 3.1.5'
gem 'listen', '~> 3'
gem 'rack-test'
gem 'rspec', '~> 3.5'
gem 'codecov', require: false
Expand Down
167 changes: 0 additions & 167 deletions Gemfile.lock

This file was deleted.

3 changes: 1 addition & 2 deletions omniauth-auth0.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ omniauth-auth0 is the OmniAuth strategy for Auth0.

s.add_runtime_dependency 'omniauth-oauth2', '~> 1.5'

s.add_development_dependency 'bundler', '~> 1.9'

s.add_development_dependency 'bundler'
s.license = 'MIT'
end
7 changes: 7 additions & 0 deletions spec/omniauth/strategies/auth0_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
)
end

around do |t|
allowed_request_methods = OmniAuth.config.allowed_request_methods
OmniAuth.config.allowed_request_methods = [:post, :get]
t.run
OmniAuth.config.allowed_request_methods = allowed_request_methods
end

describe 'client_options' do
let(:subject) { auth0.client }

Expand Down

0 comments on commit 68f0d52

Please sign in to comment.