diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17c4889..26987d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,81 +19,79 @@ jobs: - run: | npm install - run: | - npm run build && npm run package && npm test - # - run: | - # npm run all - # test: - # name: GraalVM - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # java-version: ['23', '21', '17', '20', 'dev'] - # distribution: ['graalvm', 'graalvm-community'] - # os: [ - # ubuntu-latest, - # macos-latest, # macOS on Apple silicon - # macos-13, # macOS on Intel - # windows-latest - # ] - # set-gds-token: [false] - # components: [''] - # include: - # - java-version: 'latest-ea' - # distribution: 'graalvm' - # os: ubuntu-latest - # - java-version: '24-ea' - # distribution: 'graalvm' - # os: ubuntu-latest - # - java-version: '21' - # distribution: '' - # os: ubuntu-latest - # - java-version: 'dev' - # distribution: '' - # os: windows-latest - # - java-version: '21' - # distribution: 'graalvm-community' - # os: ubuntu-latest - # components: 'native-image' # should print a warning but not fail - # - java-version: '21.0.0' # test for GA version (see #63) - # distribution: 'graalvm' - # os: ubuntu-latest - # - java-version: '17' - # distribution: 'graalvm' - # os: ubuntu-latest - # set-gds-token: true - # - java-version: '17.0.13' - # distribution: 'graalvm' - # os: ubuntu-latest - # set-gds-token: true - # steps: - # - uses: actions/checkout@v4 - # - name: Run setup-graalvm action - # uses: ./ - # with: - # java-version: ${{ matrix.java-version }} - # distribution: ${{ matrix.distribution }} - # github-token: ${{ secrets.GITHUB_TOKEN }} - # components: ${{ matrix.components }} - # gds-token: ${{ matrix.set-gds-token && secrets.GDS_TOKEN || '' }} - # - name: Check environment - # run: | - # echo "GRAALVM_HOME: $GRAALVM_HOME" - # if [[ "${{ matrix.java-version }}" == "dev" ]]; then - # [[ "$GRAALVM_HOME" == *"$RUNNER_TEMP"* ]] || exit 12 - # else - # [[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 23 - # fi - # echo "JAVA_HOME: $JAVA_HOME" - # java --version - # java --version | grep "GraalVM" || exit 34 - # native-image --version - # if: runner.os != 'Windows' - # - name: Check Windows environment - # run: | - # echo "GRAALVM_HOME: $env:GRAALVM_HOME" - # echo "JAVA_HOME: $env:JAVA_HOME" - # java --version - # native-image --version + npm run all + test: + name: GraalVM + runs-on: ${{ matrix.os }} + strategy: + matrix: + java-version: ['23', '21', '17', '20', 'dev'] + distribution: ['graalvm', 'graalvm-community'] + os: [ + ubuntu-latest, + macos-latest, # macOS on Apple silicon + macos-13, # macOS on Intel + windows-latest + ] + set-gds-token: [false] + components: [''] + include: + - java-version: 'latest-ea' + distribution: 'graalvm' + os: ubuntu-latest + - java-version: '24-ea' + distribution: 'graalvm' + os: ubuntu-latest + - java-version: '21' + distribution: '' + os: ubuntu-latest + - java-version: 'dev' + distribution: '' + os: windows-latest + - java-version: '21' + distribution: 'graalvm-community' + os: ubuntu-latest + components: 'native-image' # should print a warning but not fail + - java-version: '21.0.0' # test for GA version (see #63) + distribution: 'graalvm' + os: ubuntu-latest + - java-version: '17' + distribution: 'graalvm' + os: ubuntu-latest + set-gds-token: true + - java-version: '17.0.13' + distribution: 'graalvm' + os: ubuntu-latest + set-gds-token: true + steps: + - uses: actions/checkout@v4 + - name: Run setup-graalvm action + uses: ./ + with: + java-version: ${{ matrix.java-version }} + distribution: ${{ matrix.distribution }} + github-token: ${{ secrets.GITHUB_TOKEN }} + components: ${{ matrix.components }} + gds-token: ${{ matrix.set-gds-token && secrets.GDS_TOKEN || '' }} + - name: Check environment + run: | + echo "GRAALVM_HOME: $GRAALVM_HOME" + if [[ "${{ matrix.java-version }}" == "dev" ]]; then + [[ "$GRAALVM_HOME" == *"$RUNNER_TEMP"* ]] || exit 12 + else + [[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 23 + fi + echo "JAVA_HOME: $JAVA_HOME" + java --version + java --version | grep "GraalVM" || exit 34 + native-image --version + if: runner.os != 'Windows' + - name: Check Windows environment + run: | + echo "GRAALVM_HOME: $env:GRAALVM_HOME" + echo "JAVA_HOME: $env:JAVA_HOME" + java --version + native-image --version # test-ce: # make sure the action works on a clean machine without building # needs: test # name: CE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }} @@ -419,12 +417,16 @@ jobs: # - name: Remove components # run: gu remove espresso llvm-toolchain nodejs python ruby wasm test-sbom: - needs: build + needs: test name: test 'native-image-enable-sbom' option runs-on: macos-latest # TODO: use matrix vlaue + permissions: + contents: read + pull-requests: write # TODO: use appropriate matrix steps: - uses: actions/checkout@v4 + - name: Run setup-graalvm action - uses: ./ with: java-version: '23'