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.
This commit is contained in:
deadprogram
2026-09-10 11:42:26 +02:00
committed by Ron Evans
parent 1cd8c11cda
commit 0a956961c6
3 changed files with 199 additions and 62 deletions
+24 -10
View File
@@ -606,16 +606,35 @@ ifneq ($(OS),Windows_NT)
$(TINYGO) build -o $(SMOKE_OUT).elf -gc=leaking -scheduler=none examples/serial
endif
# The host dependent part of the quick smoke test, plus a canary that shows cross
# compilation works from this host. Cross compilation gives the same result on
# every host, thus a second runner of the same OS only needs this part.
.PHONY: smoketest-host
smoketest-host: SMOKE_OUT = build/smoke/host
smoketest-host: testchdir | build/smoke
$(TINYGO) version
$(TINYGO) targets > /dev/null
# regression test for #2892
cd tests/testing/recurse && ($(TINYGO) test ./... > recurse.log && cat recurse.log && test $$(wc -l < recurse.log) = 2 && rm recurse.log)
ifneq ($(OS),Windows_NT)
# TODO: this does not yet work on Windows. Somehow, unused functions are
# not garbage collected.
$(TINYGO) build -o $(SMOKE_OUT).elf -gc=leaking -scheduler=none examples/serial
endif
# canary, nrf52 Cortex-M4
$(TINYGO) build -size short -o $(SMOKE_OUT).hex -target=pca10040 examples/blinky1
@$(MD5SUM) $(SMOKE_OUT).hex
ifneq ($(WASM), 0)
# canary, wasm
$(TINYGO) build -size short -o $(SMOKE_OUT).wasm -target=wasm examples/wasm/main
endif
# A representative board for each processor architecture. This answers the
# question "can TinyGo build a binary for each architecture" at a fraction of
# the cost of the full smoke test, which runs separately on Linux.
.PHONY: smoketest-quick
smoketest-quick: SMOKE_OUT = build/smoke/quick
smoketest-quick: testchdir | build/smoke
$(TINYGO) version
$(TINYGO) targets > /dev/null
# regression test for #2892
cd tests/testing/recurse && ($(TINYGO) test ./... > recurse.log && cat recurse.log && test $$(wc -l < recurse.log) = 2 && rm recurse.log)
smoketest-quick: smoketest-host | build/smoke
# nrf51, Cortex-M0
$(TINYGO) build -size short -o $(SMOKE_OUT).hex -target=microbit examples/microbit-blink
@$(MD5SUM) $(SMOKE_OUT).hex
@@ -692,8 +711,3 @@ ifneq ($(WASM), 0)
# wasm without a host, so without any imports
$(TINYGO) build -size short -o $(SMOKE_OUT).wasm -target=wasm-unknown examples/hello-wasm-unknown
endif
ifneq ($(OS),Windows_NT)
# TODO: this does not yet work on Windows. Somehow, unused functions are
# not garbage collected.
$(TINYGO) build -o $(SMOKE_OUT).elf -gc=leaking -scheduler=none examples/serial
endif