Skip to content

Commit

Permalink
ORC-1709: Upgrade GitHub Action setup-java to v4 and use built-in c…
Browse files Browse the repository at this point in the history
…ache feature

### What changes were proposed in this pull request?

upgrade GitHub Action setup-java from v3 to v4

Also:  setup-java supports a "cache" attribute.  This allows us to remove the "cache" action from the workflow.

The "cache" attribute is documented in the setup-java README:
https://github.com/actions/setup-java/blob/main/README.md

<img width="783" alt="image" src="https://github.com/apache/orc/assets/30938/8cfa4a66-7539-4f43-8e37-4f6a202629cb">

### Why are the changes needed?

v4 is the latest version of setup-java

### How was this patch tested?

GitHub Actions workflow.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #1925 from sullis/setup-java-v4.

Authored-by: sullis <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
sullis authored and dongjoon-hyun committed Aug 7, 2024
1 parent 02f4060 commit bfc1d8e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Maven local repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ matrix.java }}-maven-
- name: Install Java ${{ matrix.java }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: 'maven'
- name: "Test"
run: |
mkdir -p ~/.m2
Expand Down Expand Up @@ -152,10 +146,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Install Java 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
cache: 'maven'
- name: "javadoc"
run: |
mkdir -p ~/.m2
Expand Down

0 comments on commit bfc1d8e

Please sign in to comment.