From bfc1d8e5e71fa4bc06e37ef59f878c3ec03eefe3 Mon Sep 17 00:00:00 2001 From: sullis Date: Wed, 7 Aug 2024 10:15:28 -0700 Subject: [PATCH] ORC-1709: Upgrade GitHub Action `setup-java` to v4 and use built-in cache 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 image ### 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 Signed-off-by: Dongjoon Hyun --- .github/workflows/build_and_test.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index f6fca02e8a..2b43488f6e 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -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 @@ -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