Skip to content

Commit

Permalink
Adding additional java versions to our test matrix and toolchains
Browse files Browse the repository at this point in the history
* Add 17, 21, 22, 23 to our toolchains list
* Github actions tests on  17, 21, 23 (experimental)
* Set compiler release target to 17 so that libaries built with newer javas still target 17
* Update github actions to use actions v4 instead of deprecated v3 variants
  • Loading branch information
lbergelson committed Oct 11, 2024
1 parent a37ffa6 commit f399dbc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17 ]
java: [ 17, 21]
experimental: [false]
include:
- java: 23
experimental: true
fail-fast: false
continue-on-error: ${{ matrix.experimental }}
name: Java ${{ matrix.Java }} build and test
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up java ${{ matrix.Java }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.Java }}
distribution: 'adopt'
Expand All @@ -39,7 +42,7 @@ jobs:
run: ./gradlew test jacocoTestReport
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.Java }}
path: build/reports/tests
Expand All @@ -48,9 +51,9 @@ jobs:
runs-on: ubuntu-latest
name: Tests that require external APIs
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up java 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
Expand All @@ -65,7 +68,7 @@ jobs:
# run: bash <(curl -s https://raw.githubusercontent.com/broadinstitute/codecov-bash-uploader/main/codecov-verified.bash)
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-results-external-apis
path: build/reports/tests
Expand All @@ -74,9 +77,9 @@ jobs:
runs-on: ubuntu-latest
name: FTP tests
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up java 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
Expand All @@ -91,17 +94,17 @@ jobs:
# run: bash <(curl -s https://raw.githubusercontent.com/broadinstitute/codecov-bash-uploader/main/codecov-verified.bash)
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-results-ftp
path: build/reports/tests
spotBugs:
runs-on: ubuntu-latest
name: SpotBugs
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up java 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
Expand All @@ -112,7 +115,7 @@ jobs:
run: ./gradlew spotBugsMain spotBugsTest
- name: Upload spotBugs Report
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: spotBugs-Report
path: build/reports/spotbugs
Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ dependencies {
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(22)
languageVersion = JavaLanguageVersion.of(23)
}
withJavadocJar()
withSourcesJar()
Expand All @@ -64,6 +67,7 @@ defaultTasks 'jar'

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.release.set(17)
}

tasks.withType(Javadoc).configureEach {
Expand Down

0 comments on commit f399dbc

Please sign in to comment.