| # Copyright 2025 The IREE Authors | |
| # | |
| # Licensed under the Apache License v2.0 with LLVM Exceptions. | |
| # See https://llvm.org/LICENSE.txt for license information. | |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| name: CI - macOS arm64 clang | |
| on: | |
| schedule: | |
| # Weekday mornings at 09:15 UTC = 01:15 PST (UTC - 8). | |
| - cron: "15 9 * * 1-5" | |
| workflow_call: | |
| workflow_dispatch: | |
| jobs: | |
| macos_arm64_clang: | |
| # Prevent scheduled runs in forks (only allow for iree-org or non-schedule triggers). | |
| if: ${{ github.repository_owner == 'iree-org' || github.event_name != 'schedule' }} | |
| runs-on: macos-14 | |
| env: | |
| BUILD_DIR: build-macos | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: "Checking out repository" | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: "Updating git submodules" | |
| run: git submodule update --init --jobs 8 --depth 1 | |
| # There may be multiple versions of Xcode and SDKs installed. | |
| # Select the latest Xcode app to enable using Metal offline toolchain. | |
| - name: "Update Xcode command line tools path" | |
| run: | | |
| sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer | |
| xcrun metal --version | |
| xcrun metallib --version | |
| - name: "Setting up Python" | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: "Reclaim disk space" | |
| run: | | |
| echo "=== Free space before ===" | |
| df -h / | |
| echo "=== Removing unused SDKs and tools ===" | |
| # Android SDK (~13Gi) | |
| sudo rm -rf /Users/runner/Library/Android/sdk | |
| # iOS simulators (~13Gi) | |
| sudo rm -rf /Library/Developer/CoreSimulator/Volumes/iOS_* | |
| # .NET SDK (~3Gi) | |
| sudo rm -rf /usr/local/share/dotnet | |
| # Haskell / GHC (~3Gi) | |
| sudo rm -rf /opt/ghc | |
| # Cached tool archives (~2Gi) | |
| sudo rm -rf /opt/hostedtoolcache | |
| # Old Xcode versions if present (~10Gi+ each). | |
| # Resolve the symlink since /Applications/Xcode.app is typically a | |
| # symlink to one of the versioned Xcode_*.app directories. | |
| ACTIVE_XCODE="$(readlink -f "$(xcode-select -p)/../..")" | |
| for xcode in /Applications/Xcode_*.app; do | |
| if [ -d "$xcode" ] && [ "$(readlink -f "$xcode")" != "$ACTIVE_XCODE" ]; then | |
| echo "Removing unused Xcode: $xcode" | |
| sudo rm -rf "$xcode" | |
| fi | |
| done | |
| echo "=== Free space after ===" | |
| df -h / | |
| - name: "Installing Python packages" | |
| run: pip install -r runtime/bindings/python/iree/runtime/build_requirements.txt | |
| - name: "Installing requirements" | |
| # We need coreutils for `realpath` used in scripts. | |
| # We need bash because the default one on macOS is fairly old and lacks | |
| # features we use in scripts. | |
| run: brew install ninja ccache coreutils bash | |
| - name: "Building IREE" | |
| run: bash ./build_tools/cmake/build_all.sh "${BUILD_DIR}" | |
| - name: Post to Discord on Failure | |
| uses: sarisia/actions-status-discord@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0 | |
| if: failure() && github.ref_name == 'main' && github.repository_owner == 'iree-org' | |
| with: | |
| webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
| description: "The ${{ github.workflow }} workflow failed" | |
| url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" |