Add support for macos launcher #162
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Artifacts | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| graalvm_version: '25' | |
| jobs: | |
| # This is done as one single separate step to work around rate limits for the API | |
| maven_bundle_url: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| maven_bundle_url: ${{ steps.set_url.outputs.maven_bundle_url }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Setup Java 21 | |
| id: java21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Set Maven Bundle URL | |
| id: set_url | |
| run: | | |
| tmp_file="$(mktemp)" | |
| ./scripts/maven-bundle-url.sh | tee "$tmp_file" | |
| echo "maven_bundle_url=$(tail -n 1 "$tmp_file")" >> $GITHUB_OUTPUT | |
| shell: bash | |
| pre_commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Setup Java 21 | |
| id: java21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install pre-commit | |
| run: python -m pip install --upgrade pip pre-commit | |
| shell: bash | |
| - name: run pre-commit | |
| run: pre-commit run --all-files | |
| shell: bash | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| # pre_commit not needed, but is in 'needs' to avoid wasting CI cycles in case it doesn't pass | |
| needs: [maven_bundle_url, pre_commit] | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Setup Java 21 | |
| id: java21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Set GRADLE_JAVA_HOME | |
| run: echo "GRADLE_JAVA_HOME=${{ steps.java21.outputs.path }}" >> $GITHUB_ENV | |
| shell: bash | |
| - name: Set up GraalVM | |
| uses: graalvm/setup-graalvm@v1 | |
| with: | |
| distribution: 'graalvm' | |
| java-version: ${{ env.graalvm_version }} | |
| - name: Setup Polyglot Maven bundle | |
| run: ./scripts/maven-bundle-setup.sh "${{ github.workspace }}/maven-resource-bundle" "${{ needs.maven_bundle_url.outputs.maven_bundle_url }}" | |
| shell: bash | |
| - name: Build project (skip tests) | |
| run: mvn --batch-mode -DskipTests -s settings.xml -Dgradle.java.home=$GRADLE_JAVA_HOME package verify | |
| shell: bash | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts-${{ runner.os }} | |
| path: ./**/target/** | |
| integration: | |
| needs: [build, maven_bundle_url] | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| test_name: [ test_jbang_integration.py, test_maven_plugin.py, test_gradle_plugin.py ] | |
| include: | |
| # We need to skip native-image tests on Gradle and MacOS runners: it seems that with | |
| # Gradle the tests require more RAM and cannot reliably build native image. | |
| # For other tests on MacOS we run just native-image smoke tests, because while building | |
| # native-image seems to be feasible there, it is quite slow | |
| - test_name: test_gradle_plugin.py | |
| os: macos-latest | |
| extra_test_args: "--native-image=none" | |
| - test_name: test_maven_plugin.py | |
| os: macos-latest | |
| extra_test_args: "--native-image=smoke" | |
| - test_name: test_jbang_integration.py | |
| os: macos-latest | |
| extra_test_args: "--native-image=smoke" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Set integration tests flags | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| echo "TEST_FLAGS=--skip-long-running" >> $GITHUB_ENV | |
| else | |
| echo "TEST_FLAGS=" >> $GITHUB_ENV | |
| fi | |
| shell: bash | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-artifacts-${{ runner.os }} | |
| path: . | |
| - name: Setup Java 21 | |
| id: java21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Set GRADLE_JAVA_HOME | |
| run: echo "GRADLE_JAVA_HOME=${{ steps.java21.outputs.path }}" >> $GITHUB_ENV | |
| shell: bash | |
| - name: Set up GraalVM | |
| uses: graalvm/setup-graalvm@v1 | |
| with: | |
| distribution: 'graalvm' | |
| java-version: ${{ env.graalvm_version }} | |
| - name: Setup Polyglot Maven bundle | |
| run: ./scripts/maven-bundle-setup.sh "${{ github.workspace }}/maven-resource-bundle" "${{ needs.maven_bundle_url.outputs.maven_bundle_url }}" | |
| shell: bash | |
| - name: Run Maven install | |
| run: mvn --batch-mode -s settings.xml -Dgradle.java.home=$GRADLE_JAVA_HOME -DskipTests install | |
| shell: bash | |
| - name: Install JBang (Linux/macOS) | |
| if: runner.os != 'Windows' && matrix.test_name == 'test_jbang_integration.py' | |
| run: | | |
| curl -Ls https://sh.jbang.dev | bash | |
| echo "$HOME/.jbang/bin" >> $GITHUB_PATH | |
| shell: bash | |
| - name: Install JBang (Windows) | |
| if: runner.os == 'Windows' && matrix.test_name == 'test_jbang_integration.py' | |
| run: choco install jbang | |
| shell: pwsh | |
| # - name: Setup MSVC on Windows | |
| # if: runner.os == 'Windows' | |
| # uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Add git utils to $PATH on Windows | |
| if: runner.os == 'Windows' | |
| run: echo "C:\Program Files\Git\usr\bin" >> $env:GITHUB_PATH | |
| # We scrape the output of integration tests for paths to interesting log files, | |
| # so that we can then upload them in the following actions/upload-artifact | |
| - name: Run integration tests | |
| id: tests_run | |
| run: | | |
| mvn --batch-mode -s settings.xml -Dgradle.java.home=$GRADLE_JAVA_HOME exec:java@integration-tests -Dintegration.tests.args="${{ matrix.test_name }} ${{ matrix.extra_test_args }} $TEST_FLAGS" | |
| shell: bash | |
| # /var/folders/sw/**/T/jbang*native-image | |
| # ^ not using this path on MacOS, because it causes | |
| - name: Upload JBang native-image log | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jbang-native-image-log | |
| path: | | |
| /tmp/jbang*native-image | |
| unit-tests: | |
| needs: [build, maven_bundle_url] | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| tests: [unit-cp, unit-mp, unit-it-mp, isolate-it] | |
| exclude: # TODO: isolate resources seem to not be in the bundle for those | |
| - os: macos-latest | |
| tests: isolate-it | |
| - os: windows-latest | |
| tests: isolate-it | |
| include: | |
| - tests: unit-cp | |
| maven_args: "test" | |
| - tests: unit-mp | |
| maven_args: >- | |
| -pl org.graalvm.python.embedding -Ptest.modules -am test | |
| - tests: unit-it-mp | |
| maven_args: >- | |
| -pl org.graalvm.python.embedding -Ptest.modules.integration -Dtest=org.graalvm.python.embedding.test.integration.** -am test | |
| - tests: isolate-it | |
| maven_args: >- | |
| -pl org.graalvm.python.embedding -Pisolate -Dpolyglot.engine.AllowExperimentalOptions=true -Dpolyglot.engine.SpawnIsolate=true -Dpolyglot.engine.IsolateMode=external -Dtest=org.graalvm.python.embedding.test.integration.** -am test | |
| name: "${{ matrix.tests }} (${{ matrix.os }})" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-artifacts-${{ runner.os }} | |
| path: . | |
| - name: Setup Java 21 | |
| id: java21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Set up GraalVM | |
| uses: graalvm/setup-graalvm@v1 | |
| with: | |
| distribution: 'graalvm' | |
| java-version: ${{ env.graalvm_version }} | |
| - name: Set GRADLE_JAVA_HOME | |
| run: echo "GRADLE_JAVA_HOME=${{ steps.java21.outputs.path }}" >> $GITHUB_ENV | |
| shell: bash | |
| - name: Setup Polyglot Maven bundle | |
| run: ./scripts/maven-bundle-setup.sh "${{ github.workspace }}/maven-resource-bundle" "${{ needs.maven_bundle_url.outputs.maven_bundle_url }}" | |
| shell: bash | |
| - name: Run Maven install | |
| run: mvn --batch-mode -s settings.xml -Dgradle.java.home=$GRADLE_JAVA_HOME -DskipTests install | |
| shell: bash | |
| - name: Run Maven tests | |
| run: mvn --batch-mode -s settings.xml -Dgradle.java.home=$GRADLE_JAVA_HOME ${{ matrix.maven_args }} | |
| shell: bash |