single stage #13
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 toolchain | |
| env: | |
| LLVM_REF: "cd708029e0b2869e80abe31ddb175f7c35361f90" # 19.1.7 | |
| # GH Actions are dead slow, can't build two-stage | |
| CMAKE_CACHE: "SingleStage" # ToolchainCache | |
| STAGE: "" # stage2- | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| toolchain-build: | |
| name: ${{ matrix.OS }} toolchain (${{ matrix.ARCH}}) | |
| runs-on: ${{ matrix.RUNNER }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - ARCH: x86_64 | |
| RUNNER: ubuntu-22.04 | |
| OS: Linux | |
| - ARCH: aarch64 | |
| RUNNER: ubuntu-22.04-arm | |
| OS: Linux | |
| - ARCH: aarch64 | |
| RUNNER: macos-latest | |
| OS: Darwin | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: hendrikmuhs/[email protected] | |
| with: | |
| max-size: "5000MB" | |
| - uses: actions/checkout@v5 | |
| with: | |
| repository: 'llvm/llvm-project' | |
| ref: ${{ env.LLVM_REF }} | |
| path: 'llvm' | |
| - name: Install deps | |
| if: matrix.OS == 'Linux' | |
| run: | | |
| sudo apt-get install ccache ninja-build | |
| - name: Install deps | |
| if: matrix.OS == 'Darwin' | |
| run: | | |
| brew install ccache | |
| - name: Build toolchain | |
| run: | | |
| mkdir build.dir | |
| cmake -G Ninja \ | |
| -B build.dir \ | |
| -C ${{ env.CMAKE_CACHE }}.cmake \ | |
| llvm/llvm \ | |
| -DCMAKE_INSTALL_PREFIX=${{ matrix.OS }}-${{ matrix.ARCH }}.toolchain | |
| cmake --build build.dir --target ${{ env.STAGE }}distribution | |
| cmake --build build.dir --target ${{ env.STAGE }}install-distribution | |
| tar -czvf \ | |
| ${{ matrix.OS }}-${{ matrix.ARCH }}.toolchain.tar.gz \ | |
| ${{ matrix.OS }}-${{ matrix.ARCH }}.toolchain | |
| - name: Upload toolchain | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: "*.tar.*" | |
| tag: ${{ github.run_id }} | |
| overwrite: true | |
| file_glob: true |