Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Travis CI with GitHub Actions (also favor openssl/rbnacl combinations over rails compatibility tests) #381

Merged
merged 13 commits into from Dec 3, 2020
Merged
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,62 @@
---
name: ci
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
test:
strategy:
fail-fast: false
matrix:
ruby:
- 2.3
- 2.4
- 2.5
- 2.6
- 2.7
gemfile:
- gemfiles/standalone.gemfile
- gemfiles/openssl.gemfile
- gemfiles/rbnacl.gemfile
experimental: [false]
include:
- ruby: 2.1
experimental: true
- ruby: 2.2
experimental: true
- ruby: 2.7
coverage: "true"
gemfile: 'gemfiles/rbnacl.gemfile'
- ruby: "ruby-head"
experimental: true
- ruby: "truffleruby-head"
experimental: true
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental }}
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}

steps:
- uses: actions/checkout@v2

- name: Install libsodium
run: |
sudo apt-get update -q
sudo apt-get install libsodium-dev -y

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run tests
run: bundle exec rspec

- name: Report coverage
if: ${{ success() && matrix.coverage == 'true' }}
run: bundle exec codeclimate-test-reporter
41 changes: 20 additions & 21 deletions .travis.yml
@@ -1,33 +1,32 @@
sudo: required
cache: bundler
dist: trusty
language: ruby
rvm:
- 2.3
- 2.4
- 2.5
- 2.6
- 2.5
- 2.4
- 2.3
- 2.2
- 2.1
- ruby-head
- truffleruby-head
gemfile:
- gemfiles/standalone.gemfile
- gemfiles/rails_5.0.gemfile
- gemfiles/rails_5.1.gemfile
- gemfiles/rails_5.2.gemfile
- gemfiles/rails_6.0.gemfile
script: "bundle exec rspec && bundle exec codeclimate-test-reporter"
- gemfiles/openssl.gemfile
- gemfiles/rbnacl.gemfile
script:
- bundle exec rspec
before_install:
- sudo add-apt-repository ppa:chris-lea/libsodium -y
- sudo apt-get update -q
- sudo apt-get install libsodium-dev -y
- gem install bundler

matrix:
fast_finish: true
exclude:
- gemfile: gemfiles/rails_6.0.gemfile
rvm: 2.3
- gemfile: gemfiles/rails_6.0.gemfile
rvm: 2.4
include:
- gemfile: gemfiles/standalone.gemfile
rvm: truffleruby-head
includes:
- rvm: 2.7
name: "Ruby 2.7 and Code Climate"
after_script:
- bundle exec codeclimate-test-reporter
allow_failures:
- rvm: 2.2
- rvm: 2.1
- rvm: ruby-head
- rvm: truffleruby-head
16 changes: 4 additions & 12 deletions Appraisals
@@ -1,18 +1,10 @@
appraise 'standalone' do
end

appraise 'rails-5.0' do
gem 'rails', '~> 5.0.0'
appraise 'openssl' do
gem 'openssl', '~> 2.1'
end

appraise 'rails-5.1' do
gem 'rails', '~> 5.1.0'
end

appraise 'rails-5.2' do
gem 'rails', '~> 5.2.0'
end

appraise 'rails-6.0' do
gem 'rails', '~> 6.0.0'
appraise 'rbnacl' do
gem 'rbnacl'
end
2 changes: 1 addition & 1 deletion gemfiles/rails_5.0.gemfile → gemfiles/openssl.gemfile
Expand Up @@ -2,6 +2,6 @@

source "https://rubygems.org"

gem "rails", "~> 5.0.0"
gem "openssl", "~> 2.1"

gemspec path: "../"
7 changes: 0 additions & 7 deletions gemfiles/rails_5.2.gemfile

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/rails_6.0.gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion gemfiles/rails_5.1.gemfile → gemfiles/rbnacl.gemfile
Expand Up @@ -2,6 +2,6 @@

source "https://rubygems.org"

gem "rails", "~> 5.1.0"
gem "rbnacl"

gemspec path: "../"
3 changes: 0 additions & 3 deletions ruby-jwt.gemspec
Expand Up @@ -28,7 +28,4 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'simplecov-json'
spec.add_development_dependency 'codeclimate-test-reporter'
spec.add_development_dependency 'codacy-coverage'
spec.add_development_dependency 'rbnacl'
# RSASSA-PSS support provided by OpenSSL +2.1
spec.add_development_dependency 'openssl', '~> 2.1'
end
2 changes: 1 addition & 1 deletion spec/integration/readme_examples_spec.rb
Expand Up @@ -79,7 +79,7 @@
{ 'data' => 'test' },
{ 'alg' => 'PS256' }
]
end
end if OpenSSL::VERSION >= '2.1'
end

context 'claims' do
Expand Down