Skip to content

Commit

Permalink
Update setup-java action to v4 (awspring#1241)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcindabrowski authored Sep 27, 2024
1 parent 6ca7f29 commit 57a4e5f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 68 deletions.
48 changes: 13 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,34 @@ permissions:

jobs:
build:
name: "Test with ${{ matrix.version }}"
name: Test with JDK ${{ matrix.version }}
strategy:
matrix:
version: [ 17.0.1-tem, 21-tem ]
version: [ 17.0.12, 21.0.4 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Download ${{ matrix.version }}
uses: sdkman/sdkman-action@master
id: sdkman
with:
candidate: java
version: ${{ matrix.version }}
- name: Set up ${{ matrix.version }}
uses: actions/setup-java@v1
- name: Set up JDK ${{ matrix.version }}
uses: actions/setup-java@v4
with:
java-version: 8
jdkFile: ${{ steps.sdkman.outputs.file }}
distribution: temurin
java-version: ${{ matrix.version }}
cache: maven
- name: Build with Maven
run: ./mvnw -V -B verify -Pspring
sonar:
name: "Run Sonar Analysis"
name: Run Sonar Analysis
runs-on: ubuntu-latest
# Disable Sonar for foreign PRs
if: (github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository))
steps:
- uses: actions/checkout@v4
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Download JDK
uses: sdkman/sdkman-action@master
id: sdkman
with:
candidate: java
version: 17.0.1-tem
- name: Set up JDK
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 8
jdkFile: ${{ steps.sdkman.outputs.file }}
distribution: temurin
java-version: 17.0.12
cache: maven
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
Expand Down
25 changes: 7 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,19 @@ permissions:

jobs:
build:
name: "Release"
name: Release
strategy:
matrix:
version: [ 17.0.1-tem ]
version: [ 17.0.12 ]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Cache local Maven repository
uses: actions/cache@v4
- name: Set up JDK ${{ matrix.version }}
uses: actions/setup-java@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Download ${{ matrix.version }}
uses: sdkman/sdkman-action@master
id: sdkman
with:
candidate: java
version: ${{ matrix.version }}
- name: Set up ${{ matrix.version }}
uses: actions/setup-java@v1
with:
java-version: 8
jdkFile: ${{ steps.sdkman.outputs.file }}
distribution: temurin
java-version: ${{ matrix.version }}
cache: maven
server-id: ossrh-awspring
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/upload-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: sdkman/sdkman-action@master
id: sdkman
uses: actions/setup-java@v4
with:
candidate: java
version: '17.0.1-tem'
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 8
jdkFile: ${{ steps.sdkman.outputs.file }}
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
distribution: temurin
java-version: 17.0.12
cache: maven
- name: Build docs
run: ./mvnw clean package javadoc:aggregate -Pdocs-classic,spring -DskipTests=true -e
- name: Upload to S3
Expand Down

0 comments on commit 57a4e5f

Please sign in to comment.