Skip to content

Commit 9337882

Browse files
authored
πŸ”€ πŸ› Compatibility: omniauth v1 & v2, rack v2 & v3, rack-session v1 & v2 (#6)
* πŸ› Fix compatibility with omniauth v1 & v2, rack v2 & v3, rack-session v1 & v2 - Ref: rack/rack-session#26 * πŸ‘· Add ancient build for Ruby 2.2 & 2.3 * πŸ’š Better handling of ancient ruby scenario * πŸ’š Ancient ruby support * ✨ Support Ruby 2.2 & 2.3
1 parent 9a2bf15 commit 9337882

25 files changed

+316
-58
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Ancient Ruby Support
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- '!*' # Do not execute on tags
9+
pull_request:
10+
branches:
11+
- '*'
12+
# Allow manually triggering the workflow.
13+
workflow_dispatch:
14+
15+
# Cancels all previous workflow runs for the same branch that have not yet completed.
16+
concurrency:
17+
# The concurrency group contains the workflow name and the branch name.
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test:
23+
name: Ruby ${{ matrix.ruby }}
24+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
25+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
26+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
experimental: [false]
31+
rubygems:
32+
- "2.7.11"
33+
bundler:
34+
- none
35+
gemfile:
36+
- ancient
37+
ruby:
38+
- "2.3.8"
39+
- "2.2.10"
40+
runs-on: ubuntu-20.04
41+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v3
45+
- name: Setup Ruby & Bundle
46+
uses: ruby/setup-ruby@v1
47+
with:
48+
ruby-version: ${{ matrix.ruby }}
49+
rubygems: ${{ matrix.rubygems }}
50+
bundler: ${{ matrix.bundler }}
51+
bundler-cache: true
52+
- name: Run tests
53+
run: bundle exec rspec

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Omniauth JWT Tests
33
on:
44
push:
55
branches:
6-
- 'master'
76
- 'main'
87
tags:
98
- '!*' # Do not execute on tags

β€Ž.github/workflows/coverage.ymlβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ env:
77
on:
88
push:
99
branches:
10-
- 'master'
1110
- 'main'
1211
tags:
1312
- '!*' # Do not execute on tags
@@ -25,7 +24,7 @@ concurrency:
2524

2625
jobs:
2726
test:
28-
name: Specs with Coverage - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
27+
name: Specs with Coverage - Ruby ${{ matrix.ruby }}
2928
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
3029
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
3130
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile

β€Ž.github/workflows/legacy.ymlβ€Ž

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Legacy Ruby Support
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- '!*' # Do not execute on tags
9+
pull_request:
10+
branches:
11+
- '*'
12+
# Allow manually triggering the workflow.
13+
workflow_dispatch:
14+
15+
# Cancels all previous workflow runs for the same branch that have not yet completed.
16+
concurrency:
17+
# The concurrency group contains the workflow name and the branch name.
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test:
23+
name: Ruby ${{ matrix.ruby }}
24+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
25+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
26+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
experimental: [false]
31+
rubygems:
32+
- "2.7.11"
33+
bundler:
34+
- none
35+
gemfile:
36+
- legacy
37+
ruby:
38+
- "2.6"
39+
- "2.5"
40+
- "2.4"
41+
runs-on: ubuntu-20.04
42+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v3
46+
- name: Setup Ruby & Bundle
47+
uses: ruby/setup-ruby@v1
48+
with:
49+
ruby-version: ${{ matrix.ruby }}
50+
rubygems: ${{ matrix.rubygems }}
51+
bundler: ${{ matrix.bundler }}
52+
bundler-cache: true
53+
- name: Run tests
54+
run: bundle exec rspec

β€Ž.gitignoreβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ spec/reports
1515
test/tmp
1616
test/version_tmp
1717
tmp
18+
gemfiles/*.gemfile.lock

β€Ž.tool-versionsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 2.3.8

β€ŽGemfileβ€Ž

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,15 @@ source 'https://rubygems.org'
33
# Specify your gem's dependencies in omniauth-jwt.gemspec
44
gemspec
55

6-
gem 'byebug'
6+
# Development dependencies that rely on Ruby version >=
7+
# Style
8+
eval_gemfile "gemfiles/contexts/style.gemfile"
9+
10+
# Coverage
11+
eval_gemfile "gemfiles/contexts/coverage.gemfile"
12+
13+
# Testing
14+
eval_gemfile "gemfiles/contexts/testing.gemfile"
15+
16+
# Debug
17+
eval_gemfile "gemfiles/contexts/debug.gemfile"

β€ŽRakefileβ€Ž

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ RSpec::Core::RakeTask.new(:spec)
66
desc "alias test task to spec"
77
task test: :spec
88

9-
require "kettle-soup-cover"
10-
Kettle::Soup::Cover.install_tasks
9+
begin
10+
require "kettle-soup-cover"
11+
Kettle::Soup::Cover.install_tasks
12+
rescue LoadError
13+
# NOOP
14+
end
1115

1216
task default: :spec

β€Ždiscourse-omniauth-jwt.gemspecβ€Ž

Lines changed: 0 additions & 37 deletions
This file was deleted.

β€Žgemfiles/ancient.gemfileβ€Ž

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# frozen_string_literal: true
2+
3+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4+
5+
source "https://rubygems.org"
6+
7+
# Gemfile is only for local development.
8+
# On CI we only need the gemspecs' dependencies (including development dependencies).
9+
# Exceptions, if any, will be found in gemfiles/*
10+
11+
# Testing
12+
gem "rack", "~> 2.1.4.3" # ruby 2.2.2
13+
gem "json", "~> 2.5.1" # ruby 2.0
14+
15+
# Debugging
16+
eval_gemfile "contexts/debug.gemfile"
17+
18+
gemspec path: "../"
19+
20+
gem "omniauth", "< 2"

0 commit comments

Comments
Β (0)