Skip to content

Commit 2d293f7

Browse files
committed
👷 Support JRuby in CI; ruby/rbs#2067
1 parent ef84866 commit 2d293f7

18 files changed

+130
-2
lines changed

Appraisal.root.gemfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,13 @@ source "https://gem.coop"
88
# We do not load the standard Gemfile, as it is tailored for local development.
99

1010
gemspec
11+
12+
# rbs has to be restricted in the root appraisal in order for the jruby appraisal bundles to install on jruby at all.
13+
# Note: We can't reuse the modular gemfile for jruby here because anything in this gile gets added to all appraisals,
14+
# and the paths do not align.
15+
platform "jruby" do
16+
# JRuby does not yet support RBS 1.7+, which was refactored to use a C extension to replace the native Ruby racc
17+
# https://github.com/ruby/rbs/issues/2067
18+
# https://github.com/ruby/rbs/pull/788
19+
gem "rbs", "< 1.7"
20+
end

Appraisals

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,41 @@ appraise "head" do
3636
eval_gemfile "modular/x_std_libs.gemfile"
3737
end
3838

39+
appraise "head-jruby" do
40+
platforms :jruby do
41+
# Why is gem "cgi" here? See: https://github.com/vcr/vcr/issues/1057
42+
# gem "cgi", ">= 0.5"
43+
gem "benchmark", "~> 0.4", ">= 0.4.1"
44+
eval_gemfile "modular/jruby.gemfile"
45+
eval_gemfile "modular/x_std_libs.gemfile"
46+
end
47+
end
48+
3949
# Used for current releases of ruby, truffleruby, and jruby.
4050
# Split into discrete appraisals if one of them needs a dependency locked discretely.
4151
appraise "current" do
4252
eval_gemfile "modular/x_std_libs.gemfile"
4353
end
4454

55+
appraise "current-jruby" do
56+
platforms :jruby do
57+
eval_gemfile "modular/jruby.gemfile"
58+
eval_gemfile "modular/x_std_libs.gemfile"
59+
end
60+
end
61+
4562
# Test current Rubies against head versions of runtime dependencies
4663
appraise "dep-heads" do
4764
eval_gemfile "modular/runtime_heads.gemfile"
4865
end
4966

67+
appraise "dep-heads-jruby" do
68+
platforms :jruby do
69+
eval_gemfile "modular/jruby.gemfile"
70+
eval_gemfile "modular/runtime_heads.gemfile"
71+
end
72+
end
73+
5074
appraise "ruby-3-2" do
5175
eval_gemfile "modular/x_std_libs/r3/libs.gemfile"
5276
end

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ git_source(:gitlab) { |repo_name| "https://gitlab.com/#{repo_name}" }
88
# Specify your gem's dependencies in psych-merge.gemspec
99
gemspec
1010

11+
eval_gemfile "gemfiles/modular/jruby.gemfile"
12+
1113
eval_gemfile "gemfiles/modular/debug.gemfile"
1214
eval_gemfile "gemfiles/modular/coverage.gemfile"
1315
eval_gemfile "gemfiles/modular/style.gemfile"

Gemfile.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ PATH
1515
specs:
1616
rbs-merge (1.0.0)
1717
ast-merge (~> 1.0)
18-
rbs (>= 3.0)
18+
rbs (>= 1.6)
1919
version_gem (~> 1.1, >= 1.1.9)
2020

2121
GEM
@@ -334,6 +334,7 @@ DEPENDENCIES
334334
kramdown-parser-gfm (~> 1.1)
335335
mutex_m (~> 0.2)
336336
rake (~> 13.0)
337+
rbs (< 1.7)
337338
rbs-merge!
338339
rdoc (~> 6.11)
339340
reek (~> 6.5)

gemfiles/audit.gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
source "https://gem.coop"
44

5+
platforms "jruby" do
6+
gem "rbs", "< 1.7"
7+
end
8+
59
gemspec path: "../"
610

711
eval_gemfile("modular/x_std_libs.gemfile")

gemfiles/coverage.gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
source "https://gem.coop"
44

5+
platforms "jruby" do
6+
gem "rbs", "< 1.7"
7+
end
8+
59
gemspec path: "../"
610

711
eval_gemfile("modular/coverage.gemfile")

gemfiles/current.gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
source "https://gem.coop"
44

5+
platforms "jruby" do
6+
gem "rbs", "< 1.7"
7+
end
8+
59
gemspec path: "../"
610

711
eval_gemfile("modular/x_std_libs.gemfile")

gemfiles/current_jruby.gemfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file was generated by Appraisal2
2+
3+
source "https://gem.coop"
4+
5+
platforms "jruby" do
6+
gem "rbs", "< 1.7"
7+
end
8+
9+
platforms :jruby do
10+
eval_gemfile("modular/jruby.gemfile")
11+
12+
eval_gemfile("modular/x_std_libs.gemfile")
13+
end
14+
15+
gemspec path: "../"

gemfiles/dep_heads.gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
source "https://gem.coop"
44

5+
platforms "jruby" do
6+
gem "rbs", "< 1.7"
7+
end
8+
59
gemspec path: "../"
610

711
eval_gemfile("modular/runtime_heads.gemfile")

gemfiles/dep_heads_jruby.gemfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file was generated by Appraisal2
2+
3+
source "https://gem.coop"
4+
5+
platforms "jruby" do
6+
gem "rbs", "< 1.7"
7+
end
8+
9+
platforms :jruby do
10+
eval_gemfile("modular/jruby.gemfile")
11+
12+
eval_gemfile("modular/runtime_heads.gemfile")
13+
end
14+
15+
gemspec path: "../"

0 commit comments

Comments
 (0)