Skip to content

Commit

Permalink
Merge pull request rsksmart#2640 from rsksmart/vovchyk/java21-support
Browse files Browse the repository at this point in the history
chore: add java21 support
  • Loading branch information
Vovchyk authored Sep 25, 2024
2 parents 87d4895 + 2cc5bef commit 2a0d333
Show file tree
Hide file tree
Showing 10 changed files with 336 additions and 366 deletions.
150 changes: 70 additions & 80 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,30 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Java JDK
uses: actions/setup-java@v3
- name: Setup Java & Gradle
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Verify files
run: |
curl -sSL https://secchannel.rsk.co/SUPPORT.asc | gpg2 --import -
gpg2 --verify SHA256SUMS.asc && sha256sum --check SHA256SUMS.asc
- uses: actions/cache@v4
name: Cache Gradle
id: cache-gradle
name: Cache Gradle Wrapper
id: cache-gradle-wrapper
with:
path: |
.gradle/caches
gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Get gradle wrapper and build dependencies
if: steps.cache-gradle.outputs.cache-hit != 'true'
gradle/wrapper/gradle-wrapper.jar
key: gradle-wrapper-v1

- name: Get Gradle wrapper
if: steps.cache-gradle-wrapper.outputs.cache-hit != 'true'
run: |
./configure.sh
./gradlew --no-daemon dependencies
- name: Build
run: |
Expand All @@ -56,36 +53,27 @@ jobs:
rskj-core/build
smell-test:
needs: unit-tests
needs: unit-tests-java17
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java JDK
uses: actions/setup-java@v3
- name: Setup Java & Gradle
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- uses: actions/cache@v4
name: Restore Gradle cache
id: cache-gradle
- uses: actions/cache/restore@v4
name: Restore Gradle Wrapper
with:
path: |
.gradle/caches
gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Get gradle wrapper and build dependencies
run: |
if [ ! -f gradle/wrapper/gradle-wrapper.jar ]; then
./configure.sh
./gradlew --no-daemon dependencies
fi
gradle/wrapper/gradle-wrapper.jar
key: gradle-wrapper-v1
fail-on-cache-miss: true

- name: Download build artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -192,28 +180,20 @@ jobs:
run: |
node --unhandled-rejections=strict generateBtcBlocks.js
- name: Setup Java JDK
uses: actions/setup-java@v3
- name: Setup Java & Gradle
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- uses: actions/cache@v4
name: Cache Gradle
id: cache-gradle
- uses: actions/cache/restore@v4
name: Restore Gradle Wrapper
with:
path: |
.gradle/caches
gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Get gradle wrapper and build dependencies
if: steps.cache-gradle.outputs.cache-hit != 'true'
run: |
./configure.sh
./gradlew --no-daemon dependencies
gradle/wrapper/gradle-wrapper.jar
key: gradle-wrapper-v1
fail-on-cache-miss: true

- name: Download build artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -247,34 +227,26 @@ jobs:
npm test
kill $rskpid
unit-tests:
unit-tests-java17:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Java JDK
uses: actions/setup-java@v3
- name: Setup Java & Gradle
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- uses: actions/cache@v4
name: Cache Gradle
id: cache-gradle
- uses: actions/cache/restore@v4
name: Restore Gradle Wrapper
with:
path: |
.gradle/caches
gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Get gradle wrapper and build dependencies
if: steps.cache-gradle.outputs.cache-hit != 'true'
run: |
./configure.sh
./gradlew --no-daemon dependencies
gradle/wrapper/gradle-wrapper.jar
key: gradle-wrapper-v1
fail-on-cache-miss: true

- name: Run tests
run: |
Expand All @@ -294,33 +266,51 @@ jobs:
path: |
rskj-core/build/reports/
unit-tests-java21:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Java & Gradle
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'

- uses: actions/cache/restore@v4
name: Restore Gradle Wrapper
with:
path: |
gradle/wrapper/gradle-wrapper.jar
key: gradle-wrapper-v1
fail-on-cache-miss: true

- name: Run tests
run: |
./gradlew --no-daemon --stacktrace test
integration-tests:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Java JDK
uses: actions/setup-java@v3
- name: Setup Java & Gradle
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- uses: actions/cache@v4
name: Cache Gradle
id: cache-gradle
- uses: actions/cache/restore@v4
name: Restore Gradle Wrapper
with:
path: |
.gradle/caches
gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Get gradle wrapper and build dependencies
if: steps.cache-gradle.outputs.cache-hit != 'true'
run: |
./configure.sh
./gradlew --no-daemon dependencies
gradle/wrapper/gradle-wrapper.jar
key: gradle-wrapper-v1
fail-on-cache-miss: true

- name: Run tests
run: |
Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
plugins {
id "org.sonarqube" version "2.7.1"
id "org.sonarqube" version "5.1.0.4882"
}

subprojects {
def config = new ConfigSlurper().parse(file("$projectDir/src/main/resources/version.properties").toURI().toURL())
group = 'co.rsk'
version = config.modifier?.trim() ? config.versionNumber + "-" + config.modifier : config.versionNumber
}

Loading

0 comments on commit 2a0d333

Please sign in to comment.