Skip to content

Commit cb0311f

Browse files
committed
⬆️ Allow jwt v3, and faraday head
- fix specs for JWT v3 - add appraisal for current rubies with runtime dep heads - add workflow for current rubies with runtime dep heads
1 parent 260343c commit cb0311f

32 files changed

+247
-70
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Targets the evergreen latest release of ruby, truffleruby, and jruby
2+
# and tests against the HEAD of runtime dependencies
3+
name: Runtime Deps @ HEAD
4+
5+
env:
6+
K_SOUP_COV_DO: false
7+
8+
on:
9+
push:
10+
branches:
11+
- 'main'
12+
- '*-stable'
13+
tags:
14+
- '!*' # Do not execute on tags
15+
pull_request:
16+
branches:
17+
- '*'
18+
# Allow manually triggering the workflow.
19+
workflow_dispatch:
20+
21+
permissions:
22+
contents: read
23+
24+
# Cancels all previous workflow runs for the same branch that have not yet completed.
25+
concurrency:
26+
# The concurrency group contains the workflow name and the branch name.
27+
group: "${{ github.workflow }}-${{ github.ref }}"
28+
cancel-in-progress: true
29+
30+
jobs:
31+
test:
32+
name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }}
33+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
34+
runs-on: ubuntu-latest
35+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
36+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
37+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
38+
strategy:
39+
matrix:
40+
include:
41+
# Ruby 3.4
42+
- ruby: "ruby"
43+
appraisal: "current-runtime-heads"
44+
exec_cmd: "rake test"
45+
gemfile: "Appraisal.root"
46+
rubygems: latest
47+
bundler: latest
48+
49+
# truffleruby-24.1
50+
# (according to documentation: targets Ruby 3.3 compatibility)
51+
# (according to runtime: targets Ruby 3.2 compatibility)
52+
- ruby: "truffleruby"
53+
appraisal: "current-runtime-heads"
54+
exec_cmd: "rake test"
55+
gemfile: "Appraisal.root"
56+
rubygems: default
57+
bundler: default
58+
59+
# jruby-10.0 (targets Ruby 3.4 compatibility)
60+
- ruby: "jruby"
61+
appraisal: "current-runtime-heads"
62+
exec_cmd: "rake test"
63+
gemfile: "Appraisal.root"
64+
rubygems: default
65+
bundler: default
66+
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v4
70+
71+
- name: Setup Ruby & RubyGems
72+
uses: ruby/setup-ruby@v1
73+
with:
74+
ruby-version: ${{ matrix.ruby }}
75+
rubygems: ${{ matrix.rubygems }}
76+
bundler: ${{ matrix.bundler }}
77+
bundler-cache: false
78+
79+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
80+
# We need to do this first to get appraisal installed.
81+
# NOTE: This does not use the primary Gemfile at all.
82+
- name: Install Root Appraisal
83+
run: bundle
84+
- name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}
85+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
86+
- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
87+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

Appraisals

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@
99
appraise "head" do
1010
gem "mutex_m", ">= 0.2"
1111
gem "stringio", ">= 3.0"
12-
eval_gemfile "modular/f2.gemfile"
12+
eval_gemfile "modular/runtime_heads.gemfile"
13+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
14+
end
15+
16+
# Test current Rubies against head versions of runtime dependencies
17+
appraise "current-runtime-heads" do
18+
gem "mutex_m", ">= 0.2"
19+
gem "stringio", ">= 3.0"
20+
eval_gemfile "modular/runtime_heads.gemfile"
1321
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
1422
end
1523

@@ -18,77 +26,89 @@ end
1826
appraise "current" do
1927
gem "mutex_m", ">= 0.2"
2028
gem "stringio", ">= 3.0"
21-
eval_gemfile "modular/f2.gemfile"
29+
eval_gemfile "modular/faraday_v2.gemfile"
30+
eval_gemfile "modular/jwt_v3.gemfile"
2231
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
2332
end
2433

2534
appraise "ruby-2-2" do
26-
eval_gemfile "modular/f0.gemfile"
35+
eval_gemfile "modular/faraday_v0.gemfile"
36+
eval_gemfile "modular/jwt_v1.gemfile"
2737
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
2838
end
2939

3040
appraise "ruby-2-3" do
31-
eval_gemfile "modular/f0.gemfile"
41+
eval_gemfile "modular/faraday_v0.gemfile"
42+
eval_gemfile "modular/jwt_v1.gemfile"
3243
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
3344
end
3445

3546
appraise "ruby-2-4" do
36-
eval_gemfile "modular/f1.gemfile"
47+
eval_gemfile "modular/faraday_v1.gemfile"
48+
eval_gemfile "modular/jwt_v1.gemfile"
3749
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
3850
end
3951

4052
appraise "ruby-2-5" do
41-
eval_gemfile "modular/f1.gemfile"
53+
eval_gemfile "modular/faraday_v1.gemfile"
54+
eval_gemfile "modular/jwt_v2.gemfile"
4255
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
4356
end
4457

4558
appraise "ruby-2-6" do
4659
gem "mutex_m", "~> 0.2"
4760
gem "stringio", "~> 3.0"
48-
eval_gemfile "modular/f2.gemfile"
61+
eval_gemfile "modular/faraday_v2.gemfile"
62+
eval_gemfile "modular/jwt_v2.gemfile"
4963
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
5064
end
5165

5266
appraise "ruby-2-7" do
5367
gem "mutex_m", "~> 0.2"
5468
gem "stringio", "~> 3.0"
55-
eval_gemfile "modular/f2.gemfile"
69+
eval_gemfile "modular/faraday_v2.gemfile"
70+
eval_gemfile "modular/jwt_v2.gemfile"
5671
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
5772
end
5873

5974
appraise "ruby-3-0" do
6075
gem "mutex_m", "~> 0.2"
6176
gem "stringio", "~> 3.0"
62-
eval_gemfile "modular/f2.gemfile"
77+
eval_gemfile "modular/faraday_v2.gemfile"
78+
eval_gemfile "modular/jwt_v2.gemfile"
6379
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
6480
end
6581

6682
appraise "ruby-3-1" do
6783
gem "mutex_m", "~> 0.2"
6884
gem "stringio", "~> 3.0"
69-
eval_gemfile "modular/f2.gemfile"
85+
eval_gemfile "modular/faraday_v2.gemfile"
86+
eval_gemfile "modular/jwt_v2.gemfile"
7087
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
7188
end
7289

7390
appraise "ruby-3-2" do
7491
gem "mutex_m", "~> 0.2"
7592
gem "stringio", "~> 3.0"
76-
eval_gemfile "modular/f2.gemfile"
93+
eval_gemfile "modular/faraday_v2.gemfile"
94+
eval_gemfile "modular/jwt_v2.gemfile"
7795
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
7896
end
7997

8098
appraise "ruby-3-3" do
8199
gem "mutex_m", "~> 0.2"
82100
gem "stringio", "~> 3.0"
83-
eval_gemfile "modular/f2.gemfile"
101+
eval_gemfile "modular/faraday_v2.gemfile"
102+
eval_gemfile "modular/jwt_v2.gemfile"
84103
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
85104
end
86105

87106
# Only run security audit on latest Ruby version
88107
appraise "audit" do
89108
gem "mutex_m", "~> 0.2"
90109
gem "stringio", "~> 3.0"
91-
eval_gemfile "modular/f2.gemfile"
110+
eval_gemfile "modular/faraday_v2.gemfile"
111+
eval_gemfile "modular/jwt_v2.gemfile"
92112
eval_gemfile "modular/audit.gemfile"
93113
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
94114
end
@@ -97,7 +117,8 @@ end
97117
appraise "coverage" do
98118
gem "mutex_m", "~> 0.2"
99119
gem "stringio", "~> 3.0"
100-
eval_gemfile "modular/f2.gemfile"
120+
eval_gemfile "modular/faraday_v2.gemfile"
121+
eval_gemfile "modular/jwt_v2.gemfile"
101122
eval_gemfile "modular/coverage.gemfile"
102123
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
103124
end
@@ -106,7 +127,6 @@ end
106127
appraise "style" do
107128
gem "mutex_m", "~> 0.2"
108129
gem "stringio", "~> 3.0"
109-
eval_gemfile "modular/f2.gemfile"
110130
eval_gemfile "modular/style.gemfile"
111131
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
112132
end
@@ -115,7 +135,8 @@ appraise "omnibus" do
115135
eval_gemfile "modular/audit.gemfile"
116136
eval_gemfile "modular/coverage.gemfile"
117137
eval_gemfile "modular/documentation.gemfile"
118-
eval_gemfile "modular/f2.gemfile"
138+
eval_gemfile "modular/faraday_v2.gemfile"
139+
eval_gemfile "modular/jwt_v2.gemfile"
119140
eval_gemfile "modular/style.gemfile"
120141
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
121142
end

Gemfile.lock

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
GIT
2+
remote: https://github.com/jwt/ruby-jwt
3+
revision: 6aac2d682b04ac62962989be18479040f806f34e
4+
branch: main
5+
specs:
6+
jwt (3.0.0.beta1)
7+
base64
8+
19
GIT
210
remote: https://github.com/pboling/appraisal
311
revision: a3a3e4b7db67d9b085f96b2ffddd2b51bd8a1196
@@ -25,7 +33,7 @@ PATH
2533
specs:
2634
oauth2 (2.0.10)
2735
faraday (>= 0.17.3, < 3.0)
28-
jwt (>= 1.0, < 3.0)
36+
jwt (>= 1.0, < 4.0)
2937
multi_xml (~> 0.5)
3038
rack (>= 1.2, < 4)
3139
snaky_hash (~> 2.0)
@@ -98,8 +106,6 @@ GEM
98106
rdoc (>= 4.0.0)
99107
reline (>= 0.4.2)
100108
json (2.12.0)
101-
jwt (2.10.1)
102-
base64
103109
kettle-soup-cover (1.0.6)
104110
simplecov (~> 0.22)
105111
simplecov-cobertura (~> 2.1)
@@ -166,7 +172,7 @@ GEM
166172
ruby_version (~> 1.0)
167173
rspec-stubbed_env (1.0.2)
168174
rspec-support (3.13.3)
169-
rubocop (1.75.5)
175+
rubocop (1.75.6)
170176
json (~> 2.3)
171177
language_server-protocol (~> 3.17.0.2)
172178
lint_roller (~> 1.1.0)
@@ -286,15 +292,16 @@ DEPENDENCIES
286292
bundler-audit (~> 0.9.2)
287293
debug (>= 1.0.0)
288294
gem_bench (~> 2.0, >= 2.0.5)
295+
jwt!
289296
kettle-soup-cover (~> 1.0, >= 1.0.6)
290297
nkf (~> 0.2)
291298
oauth2!
292-
rake (>= 12)
299+
rake (~> 13.0)
293300
rdoc (~> 6.11)
294301
reek (~> 6.4)
295302
rexml (>= 3)
296-
rspec (>= 3)
297-
rspec-block_is_expected
303+
rspec (~> 3.13)
304+
rspec-block_is_expected (~> 1.0)
298305
rspec-pending_for
299306
rspec-stubbed_env
300307
rubocop (~> 1.73, >= 1.73.2)

gemfiles/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# History
22

3+
This document will become out-of-date quickly, but remains historically relevant until
4+
such time as this gem is released with support for non-EOL Ruby only.
5+
36
`faraday` v0.17.3 is the first version that stops using `&Proc.new` for block forwarding,
47
and thus is the oldest version oauth2 is compatible with.
58

gemfiles/audit.gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ source "https://rubygems.org"
55
gem "mutex_m", "~> 0.2"
66
gem "stringio", "~> 3.0"
77

8-
gemspec path: "../"
8+
gemspec :path => "../"
99

10-
eval_gemfile("modular/f2.gemfile")
10+
eval_gemfile("modular/faraday_v2.gemfile")
11+
12+
eval_gemfile("modular/jwt_v2.gemfile")
1113

1214
eval_gemfile("modular/audit.gemfile")

gemfiles/coverage.gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ source "https://rubygems.org"
55
gem "mutex_m", "~> 0.2"
66
gem "stringio", "~> 3.0"
77

8-
gemspec path: "../"
8+
gemspec :path => "../"
99

10-
eval_gemfile("modular/f2.gemfile")
10+
eval_gemfile("modular/faraday_v2.gemfile")
11+
12+
eval_gemfile("modular/jwt_v2.gemfile")
1113

1214
eval_gemfile("modular/coverage.gemfile")

gemfiles/current.gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ source "https://rubygems.org"
55
gem "mutex_m", ">= 0.2"
66
gem "stringio", ">= 3.0"
77

8-
gemspec path: "../"
8+
gemspec :path => "../"
99

10-
eval_gemfile("modular/f2.gemfile")
10+
eval_gemfile("modular/faraday_v2.gemfile")
11+
12+
eval_gemfile("modular/jwt_v3.gemfile")
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "mutex_m", ">= 0.2"
6+
gem "stringio", ">= 3.0"
7+
8+
gemspec :path => "../"
9+
10+
eval_gemfile("modular/runtime_heads.gemfile")

gemfiles/head.gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ source "https://rubygems.org"
55
gem "mutex_m", ">= 0.2"
66
gem "stringio", ">= 3.0"
77

8-
gemspec path: "../"
8+
gemspec :path => "../"
99

10-
eval_gemfile("modular/f2.gemfile")
10+
eval_gemfile("modular/runtime_heads.gemfile")

gemfiles/modular/f0.gemfile

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

0 commit comments

Comments
 (0)