Files
tinygo/.github/actions/setup-llvm-macos/action.yml
T
deadprogram 0a956961c6 ci: split the macOS jobs, and test only the host on the intel runner
The macos-15-intel job was the critical path of CI at 1h21m44s. It ran
gen-device, make test, make release, make tinygo-test, and
make smoketest-quick one after the other.

Split the work into four jobs, the same pattern as windows.yml.
build-macos publishes the release tarball, stdlib-test-macos and
smoke-test-macos download it, and test-macos restores the LLVM cache and
runs at the same time as build-macos. The LLVM steps move to a new
setup-llvm-macos composite action, with a save-cache input so that only
build-macos writes the cache.

Most of smoketest-quick is cross compilation, which gives the same result
on every host. Add a smoketest-host target with the host dependent part
plus a Cortex-M and a wasm canary, and use it on the intel runner. The
arm64 runner keeps the full set.

The intel runner still tests darwin/amd64 with make test, make
tinygo-test, and smoketest-host.
2026-09-10 18:50:20 +02:00

66 lines
2.1 KiB
YAML

name: Set up LLVM on macOS
description: Restore or build LLVM
inputs:
os:
description: Runner image name, used in the cache key
required: true
save-cache:
description: Save LLVM caches after a cache miss
required: false
default: "true"
runs:
using: composite
steps:
- name: Restore LLVM source cache
uses: actions/cache/restore@v5
id: cache-llvm-source
with:
key: llvm-source-22-${{ inputs.os }}-v1-${{ hashFiles('llvm-version.txt') }}
path: |
llvm-project/clang/lib/Headers
llvm-project/clang/include
llvm-project/compiler-rt
llvm-project/lld/include
llvm-project/llvm/include
- name: Download LLVM source
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
shell: bash
run: make llvm-source
- name: Save LLVM source cache
uses: actions/cache/save@v5
if: inputs.save-cache == 'true' && steps.cache-llvm-source.outputs.cache-hit != 'true'
with:
key: ${{ steps.cache-llvm-source.outputs.cache-primary-key }}
path: |
llvm-project/clang/lib/Headers
llvm-project/clang/include
llvm-project/compiler-rt
llvm-project/lld/include
llvm-project/llvm/include
- name: Restore LLVM build cache
uses: actions/cache/restore@v5
id: cache-llvm-build
with:
key: llvm-build-22-${{ inputs.os }}-v1-${{ hashFiles('llvm-version.txt') }}
path: llvm-build
- name: Build LLVM
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
shell: bash
run: |
# fetch LLVM source
rm -rf llvm-project
make llvm-source
# install dependencies
HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja
# build!
make llvm-build
find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \;
- name: Save LLVM build cache
uses: actions/cache/save@v5
if: inputs.save-cache == 'true' && steps.cache-llvm-build.outputs.cache-hit != 'true'
with:
key: ${{ steps.cache-llvm-build.outputs.cache-primary-key }}
path: llvm-build