From dbf2cd04c46adfe17f39a703c2da1e67fafdfec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=99=93=E4=BC=9F?= Date: Thu, 17 Oct 2024 10:59:42 +0800 Subject: [PATCH] :construction_worker: use actions/setup-java graalvm https://github.com/actions/setup-java/issues/667 https://github.com/actions/setup-java/pull/501 --- .github/workflows/native.yaml | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml index 183cb869a..6a72642bd 100644 --- a/.github/workflows/native.yaml +++ b/.github/workflows/native.yaml @@ -24,7 +24,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macOS-latest ] - java: [ 17.0.9, 21.0.2, 22.0.2 ] + java: [ '17.0.12', '21', '22' ] fail-fast: false max-parallel: 5 name: Test GraalVM JDK ${{ matrix.java }}, ${{ matrix.os }} @@ -32,31 +32,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Ubuntu Set up JDK - if: ${{ matrix.os == 'ubuntu-latest' }} - run: | - JAVA_HOME=$RUNNER_WORKSPACE/.graalvm - echo $JAVA_HOME - mkdir -p $JAVA_HOME - echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV - curl -L -o graalvm.tar.gz https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${{ matrix.java }}/graalvm-community-jdk-${{ matrix.java }}_linux-x64_bin.tar.gz - tar -zxvf graalvm.tar.gz -C $JAVA_HOME --strip-components=1 - ls -lh $JAVA_HOME - mvn -v - - - name: MacOS Set up JDK - if: ${{ matrix.os == 'macOS-latest' }} - run: | - JAVA_HOME=$RUNNER_WORKSPACE/.graalvm - echo $JAVA_HOME - mkdir -p $JAVA_HOME - curl -L -o graalvm.tar.gz https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${{ matrix.java }}/graalvm-community-jdk-${{ matrix.java }}_macos-x64_bin.tar.gz - tar -zxvf graalvm.tar.gz -C $JAVA_HOME --strip-components=1 - JAVA_HOME=$RUNNER_WORKSPACE/.graalvm/Contents/Home - echo $JAVA_HOME - echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV - ls -lh $JAVA_HOME - mvn -v + - uses: actions/setup-java@v4 + with: + distribution: 'graalvm' + java-version: ${{ matrix.java }} - name: Cache modules uses: actions/cache@v4