build google-java-format (w/patched libs) #15
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 google-java-format (w/patched libs)" | |
| # to access artifacts from the patched libs action | |
| permissions: | |
| contents: read | |
| actions: read | |
| "on": | |
| workflow_dispatch: | |
| jobs: | |
| build-via-native-image: | |
| name: "build google-java-format via native-image" | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - platform: ubuntu-24.04 | |
| arch: 'x86_64' | |
| - platform: ubuntu-24.04-arm | |
| arch: 'aarch64' | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: "clone repo" | |
| uses: actions/checkout@v4 | |
| - name: "download cosmocc" | |
| uses: actions/download-artifact@v7 | |
| with: | |
| run-id: 21328957334 | |
| name: cosmocc-6d33251cbbb6f895185199629052663d3b4535cb | |
| github-token: ${{ github.token }} | |
| - name: "download labs JDK libs" | |
| uses: actions/download-artifact@v7 | |
| with: | |
| run-id: 21328957334 | |
| name: labs-${{ matrix.arch }}-libs-6d33251cbbb6f895185199629052663d3b4535cb | |
| github-token: ${{ github.token }} | |
| - name: "download graal helper libs" | |
| uses: actions/download-artifact@v7 | |
| with: | |
| run-id: 21328957334 | |
| name: graal-${{ matrix.arch }}-libs-6d33251cbbb6f895185199629052663d3b4535cb | |
| github-token: ${{ github.token }} | |
| - name: "build native image from source" | |
| run: make ARCH=${{ matrix.arch }} build-native-image | |
| - name: "setup downloaded artifacts" | |
| run: ARCH=${{ matrix.arch }} bash scripts/download-partials-setup.sh | |
| - name: "build google-java-format" | |
| run: make ARCH=${{ matrix.arch }} build-google-java-format | |
| - name: "upload google-java-format" | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: google-java-format-${{ matrix.arch }} | |
| overwrite: true | |
| path: ./build/google-java-format.${{ matrix.arch }} | |
| compression-level: 0 | |
| build-ape: | |
| name: "build APE" | |
| needs: [build-via-native-image] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: "clone repo" | |
| uses: actions/checkout@v4 | |
| - name: "get cosmocc artifact" | |
| uses: actions/download-artifact@v7 | |
| with: | |
| run-id: 21328957334 | |
| name: cosmocc-6d33251cbbb6f895185199629052663d3b4535cb | |
| github-token: ${{ github.token }} | |
| - name: "get x86_64 google-java-format artifact" | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: google-java-format-x86_64 | |
| - name: "get aarch64 google-java-format artifact" | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: google-java-format-aarch64 | |
| - name: "setup cosmocc" | |
| run: | | |
| mkdir -p testing/cosmopolitan | |
| cd testing/cosmopolitan | |
| unzip -qo ../../cosmocc.zip | |
| cd ../../ | |
| - name: "build APE" | |
| run: bash scripts/apelinkpls.sh google-java-format | |
| - name: "upload APE" | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: google-java-format-APE | |
| overwrite: true | |
| path: ./google-java-format.com | |
| compression-level: 0 | |
| test-ape: | |
| name: "Test APE" | |
| needs: [build-ape] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: ubuntu-24.04 | |
| type: 'nix' | |
| - platform: ubuntu-24.04-arm | |
| type: 'nix' | |
| - platform: macos-15-intel | |
| type: 'nix' | |
| - platform: macos-15 | |
| type: 'nix' | |
| - platform: windows-latest | |
| type: 'win32' | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: "Setup: Download Artifact" | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: google-java-format-APE | |
| - name: "download sample java file" | |
| if: matrix.type == 'nix' | |
| shell: bash | |
| run: curl -o sample.java 'https://raw.githubusercontent.com/elide-dev/graal/refs/heads/master/substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/PosixSignalHandlerSupport.java' | |
| - name: "download sample java file (windows)" | |
| if: matrix.type == 'win32' | |
| shell: pwsh | |
| run: curl -o sample.java 'https://raw.githubusercontent.com/elide-dev/graal/refs/heads/master/substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/PosixSignalHandlerSupport.java' | |
| - name: "Run: (*nix)" | |
| if: matrix.type == 'nix' | |
| shell: bash | |
| run: chmod +x ./google-java-format.com && ./google-java-format.com sample.java | |
| - name: "Run: (win32)" | |
| if: matrix.type == 'win32' | |
| shell: pwsh | |
| run: '& .\google-java-format.com sample.java' |