Skip to content

Commit b739313

Browse files
committed
Improve CI permissions and fix Java for JRuby 10
Workflows run with extended set of permissions by default. By specifying any permission explicitly, all others are set to none. Ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions JRuby 10.0 Requires Java 21 but Java 17 was used. This eliminates the following error: ``` Error: LinkageError occurred while loading main class org.jruby.Main java.lang.UnsupportedClassVersionError: org/jruby/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0 JRuby failed to start, try Java 21 envs ```
1 parent 5e15e9d commit b739313

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/ruby.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test:
1114

@@ -15,6 +18,12 @@ jobs:
1518
ruby-version: ['3.1', '3.2', '3.3', '3.4', 'jruby-9.4', 'jruby-10.0']
1619

1720
steps:
21+
- name: Set up Java for JRuby 10.0
22+
if: matrix.ruby-version == 'jruby-10.0'
23+
uses: actions/setup-java@v5
24+
with:
25+
distribution: 'temurin'
26+
java-version: '21'
1827
- uses: actions/checkout@v5
1928
- name: Set up Ruby
2029
uses: ruby/setup-ruby@v1

0 commit comments

Comments
 (0)