name: GraalVM Native Image builds on: push: branches: [ "main" ] tags: - '*' pull_request: branches: [ "main" ] permissions: contents: read jobs: build: name: bt and st on ${{ matrix.os }}-${{ matrix.arch }} runs-on: ${{ matrix.label }} strategy: matrix: # See: https://docs.github.com/en/actions/concepts/runners/about-github-hosted-runners#overview-of-github-hosted-runners # ... and follow the links to the related Github repositories include: - label: ubuntu-latest os: linux arch: x86_64 - label: ubuntu-24.04-arm os: linux arch: aarch64 - label: windows-latest os: windows arch: x86_64 - label: macos-15-intel os: darwin arch: x86_64 - label: macos-15 os: darwin arch: arm64 steps: - uses: actions/checkout@v4 - uses: graalvm/setup-graalvm@v1 with: java-version: '21' distribution: 'graalvm-community' github-token: ${{ secrets.GITHUB_TOKEN }} native-image-job-reports: 'true' # Note that Graal v21 builds to the current architecture, and "--target" is not functional. # Therefore, we try to find runners that fit our targets (see above). - name: Build 'bt' and 'st' run: ./gradlew nativeCompile env: # Needed for Windows; not an issue for other OSes GRADLE_OPTS: -Djava.io.tmpdir=${{ runner.temp }} - name: Run CLTH tests if: ${{ matrix.os != 'windows' }} shell: bash run: ./scripts/run-clth-tests.sh - name: Upload 'bt' binary uses: actions/upload-artifact@v4 with: name: bt-${{ matrix.os }}-${{ matrix.arch }} path: tools/bt/build/native/nativeCompile/bt* - name: Upload 'st' binary uses: actions/upload-artifact@v4 with: name: st-${{ matrix.os }}-${{ matrix.arch }} path: tools/st/build/native/nativeCompile/st*