Skip to content

Commit 496805c

Browse files
committed
Specify Java 21 using asdf's .tool-versions
This is motivated by guardian/gha-scala-library-release-workflow#31 - initially I was just thinking about updating to Java 21, but now I think that making projects declare which Java version they use to build is probably a good thing! Note that we're using asdf's .tool-versions file here, which has recently gained support in actions/setup-java#606 - this means that we can also get _all_ our GitHub Actions files to respect the Java version definied in that file - eg, we can reference it in ci.yml, and we don't need to update Java version in there anymore.
1 parent 1825fd8 commit 496805c

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
- name: Setup JDK
19-
uses: actions/setup-java@v3
19+
uses: actions/setup-java@v4
2020
with:
2121
distribution: corretto
22-
java-version: 17 # Currently Java 17 required by `s3mock-testcontainers`
22+
java-version-file: .tool-versions
2323
cache: sbt
2424
- name: Build and Test
2525
run: sbt -v +test

‎.tool-versions‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
java corretto-21.0.2.13.1

0 commit comments

Comments
 (0)