Skip to content

ci: Move iOS and macOS test lanes to GitHub Actions - #26090

Open
MartinZikmund wants to merge 5 commits into
masterfrom
dev/mazi/macos-gha-spike
Open

MartinZikmund wants to merge 5 commits into
masterfrom
dev/mazi/macos-gha-spike

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: related to unoplatform/uno-private#2564

Important

Do not merge yet. macOS CI result is not a required check, so iOS and macOS failures could merge unnoticed, and macOS runner capacity is not enough today: this PR's own macOS run took 3 h 58 min end to end for about 3 h 4 min of job time, competing with uno.templates (see Known gaps).

Results on this PR: the macOS CI run passed with failed=0 on all 10 lanes and the same test counts as ADO. ADO build 243930 used no per-minute agents. It failed on Android and WebAssembly: most of the Android failures also occur on master at the same commit, and the WebAssembly one is a single Given_ScrollView test on the WebGPU lane. Neither lane uses anything this PR changes.

PR Type:

🏗️ Build or CI related changes

What changed? 🚀

The iOS and macOS desktop runtime test lanes move from the per-minute GitHub-hosted Agents pool on Azure Pipelines to GitHub Actions, where the same xcode-27 runners are free for public repositories. They reuse the existing test scripts.

Lane Before After
iOS SamplesApp build, 4 Skia and 4 WebGPU groups Azure, per-minute GitHub Actions
macOS desktop Skia and WebGPU tests Azure, per-minute GitHub Actions, including its own native and desktop builds
Native macOS build for packages Azure, per-minute Azure, flat-rate macOS-26
TestFlight, DevServer CLI macOS Azure Unchanged

Why some macOS work stays on Azure:

  • Native build: the Windows managed build and the NuGet packages consume this artifact, and Azure Pipelines can't download a GitHub Actions artifact without a token, which fork PR builds don't get. It doesn't need Xcode 27.
  • TestFlight: it needs signing secrets and the App Store service connection. It also already fails on master, because its pool has no route to xcode-27.
  • DevServer CLI macOS: it's on the flat-rate pool and consumes Azure package artifacts and secrets.

ci-macos.yml mirrors the Azure branch and path filters, and gates WebGPU on PRs by running the same determine-test-scope.ps1. New pushes cancel a PR's running jobs.

Evidence so far (fork run on 79f70a81e42, before this PR's changes)

All jobs passed, and test counts match ADO build 243847 of the same commit on all 10 lanes, comparing total + skipped with the results ADO published:

Lane Tests per group Test step, GitHub Test step, ADO
iOS Skia 2858, 2413, 3460, 3088 9.8-23.9 min 6.6-10.2 min
iOS WebGPU 2858, 2412, 3460, 3088 11.7-18.9 min 7.2-9.4 min
macOS Skia 11828 15.7 min 13.4 min
macOS WebGPU 11827 15.2 min 14.7 min

Build steps: iOS 22.2 min against 6.3 on ADO, desktop 8.6 min on macOS against 13.3 on Windows.

Known gaps before this can merge

  • Required check: only Uno.UI - CI is required today. macOS CI result needs adding to the rulesets, which takes an admin.
  • Concurrency, the main blocker: Team plan runners allow 5 concurrent macOS jobs across the org, and unoplatform/uno.templates CI already fills them: on 5 Nov it had 5 jobs running and more queued since 01:40, while this PR's macOS jobs waited with no runner. Replaying the 2-4 Nov job mix from this repo alone through a simulated queue gives a median wait of about 66 min per job at 5 slots and almost none at 10, before counting uno.templates. That simulation models arrivals only and predates PR scoping such as ci(ios): Run one iOS test group on PRs without UIKit changes #26067. This needs a limit increase from GitHub Support, a plan change, or less macOS use in uno.templates.
  • Native library coverage: the macOS tests here use a library built with the macOS 27.0 SDK, while packages now ship one built on macOS-26 with 26.5. Both contain x86_64 and arm64 and target macOS 12.0.
  • iOS speed: reproducible and not yet explained. The iOS build step took 22.2 min on the fork and 19.2 min here, against 6.3 min on ADO. Test groups took 11.5-16.8 min here, against 6.6-10.2 min on ADO. Desktop lanes are close to ADO. The hardware reports the same, so build configuration is the first suspect; comparing the binlogs should settle it.
  • Lost from Azure: the Tests tab and history for these lanes, retrying only failed tests on a re-run, and NBGV version stamping of the test app. Results appear in each job's summary instead.
  • Fork PRs: first-time contributors need a maintainer to approve the run. Not yet tested.
  • Overlap: ci(ios): Run one iOS test group on PRs without UIKit changes #26067 edits the iOS lanes removed here, so one of the two needs reworking.

PR Checklist ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_01TXMNtzuHnsAaQvehBu4gYL

@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Nov 5, 2026
@MartinZikmund MartinZikmund changed the title chore: Spike macOS CI on GitHub Actions ci: Move iOS and macOS test lanes to GitHub Actions Nov 5, 2026
@MartinZikmund
MartinZikmund marked this pull request as ready for review November 5, 2026 10:06
Copilot AI balanced review requested due to automatic review settings November 5, 2026 10:06
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 33s —— View job


Review summary

Verdict: fix-first (minor). The migration is well structured. It reuses the existing scripts, keeps Azure-only dependencies (native build for packages, TestFlight, DevServer CLI) where they are, and the fork-run evidence matches ADO test counts. I found no blocking defects in the workflow logic.

Findings: 0 high, 1 medium, 3 low (all inline).

Cross-cutting concerns

  • Review scope: I read the three added files in full. I did not review the Azure YAML deletions and edits (.azure-devops-stages.yml, build-native, runtime-stages), because the checkout had no merge base with origin/master, so I couldn't produce the diff. I did not run anything or check CI status.
  • Merge gating: the macOS CI result check is not yet required, and it won't report on path-filtered PRs (see the medium inline comment). Both need settling together before the ruleset change.
  • Capacity: the 5-concurrent-macOS-job limit (about 66 min median queue in your simulation) is the biggest merge risk. It isn't code-fixable, but it should be decided explicitly. Note that cancel-in-progress only helps PRs, not pushes to master or release/*.
  • Lost signal: the Tests tab, history and failed-test-only retry go away. The job summary partly compensates, but the summary script only counts Failed results, not crashes that produce a partial XML. It does fail on a missing results file, which covers most of that.
  • Supply chain: actions are pinned to major tags (@v4) rather than SHAs. That's acceptable for first-party actions, and permissions are contents: read with no secrets, which is good for fork PRs.
  • PR hygiene: the checklist is unchecked for validating the Screenshots Compare run. That's probably N/A for a CI-only change.
    · branch dev/mazi/macos-gha-spike

- '!build/.markdownlint.json'
pull_request:
branches: *branches
paths: *paths

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required check vs. path filters (medium). The workflow is path-filtered, so macOS CI result is never created for PRs that only touch docs, markdown or .github/**. If an admin makes it a required check, those PRs will wait forever on "Expected". The same applies to PRs targeting branches outside the list. Either drop paths here and gate inside the scope job (skipped legs would then need to count as success in result), or only require the check through a ruleset that has the same path conditions. The PR description's "Known gaps" doesn't mention this.

Comment on lines +64 to +67
$output = & build/ci/scripts/determine-test-scope.ps1 6>&1 | Out-String
Write-Host $output
$required = $output -match 'WebGpuTestsRequired requires tests: true'
"webgpu=$($required.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fragile scope detection (low). WebGPU gating depends on matching the log line WebGpuTestsRequired requires tests: true in the script's host output. If the wording changes, or the script prints nothing, webgpu silently becomes false and WebGPU coverage disappears with every job still green. Consider having the script emit an explicit output (or fail this step when the expected marker is absent), so a mismatch fails loudly instead of skipping tests.

Comment on lines +279 to +294
# One stable name for a ruleset to require, whichever matrix legs ran.
result:
name: macOS CI result
if: always()
needs: [ scope, native, desktop-build, desktop-tests, ios-build, ios-tests ]
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Fail unless every job succeeded
env:
RESULTS: ${{ join(needs.*.result, ' ') }}
run: |
echo "$RESULTS"
for r in $RESULTS; do
[ "$r" = "success" ] || exit 1
done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aggregator (low). [ "$r" = "success" ] treats skipped as a failure. That's right today because every leg always runs, but it will break as soon as someone adds a conditional job (for example the PR scoping in #26067). Prefer failing only on failure or cancelled, and keep skipped as acceptable where intended. Also note that fail-fast: false plus cancel-in-progress produces cancelled results on superseded pushes, which is the desired outcome here.

run: |
dotnet tool update --global uno.check --version "$GlobalUnoCheckVersion" --add-source https://api.nuget.org/v3/index.json
# The skipped checks can report failure; a missing workload fails the build that follows.
uno-check -v --ci --non-interactive --fix --skip androidemulator --skip xcode --skip gtk3 --skip vswin --skip maui --skip vsmac --skip unosdk --skip dotnetnewunotemplates --pre-major --preview-major --tfm "${{ inputs.uno-check-tfm }}" || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swallowed failure (low). || true hides every uno-check failure, including a failed workload install. The build that follows will fail with a less obvious error, and the cache step may save a half-installed .dotnet. Consider verifying the result with dotnet workload list and failing there with a clear message. Also, the .dotnet cache is keyed without the runner image or Xcode version, so a stale iOS workload pack could be reused after a runner image bump.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The migration leaves gaps in WebGPU and master-health validation, risks blocking excluded-path PRs once the result check is required, and introduces redundant native compilation.

4 open issues
What changed in this PR

Moves iOS and macOS runtime testing from Azure’s per-minute pool to GitHub Actions, reusing existing test scripts while retaining Azure’s native build for package consumers.

Changes:

  • Adds iOS and macOS Skia/WebGPU build-and-test jobs with scope detection and an aggregate result check.
  • Adds shared macOS setup, caching, artifact handling, and test-result summaries.
  • Removes the replaced Azure test lanes and moves Azure’s native macOS build to the flat-rate pool.
File Description
build/​ci/​tests/​.azure-devops-tests-runtime-stages.yml Removes iOS and macOS runtime-test stages.
build/​ci/​tests/​.azure-devops-tests-ios.yml Deletes the Azure iOS test-group template.
build/​ci/​tests/​.azure-devops-tests-ios-runner.yml Deletes the Azure iOS runner template.
build/​ci/​tests/​.azure-devops-tests-ios-build.yml Deletes the Azure iOS app-build template.
build/​ci/​tests/​.azure-devops-tests-desktop-macos.yml Deletes the Azure macOS test template.
build/​ci/​build/​.azure-devops-build-native.yml Removes the per-minute pool selection.
build/​ci/​.azure-devops-stages.yml Selects macOS-26 for Azure’s native build.
.github/​workflows/​ci-macos.yml Adds replacement build/test jobs and aggregate check.
.github/​actions/​macos-ci-setup/​summary.py Summarizes results and fails on failed tests or missing files.
.github/​actions/​macos-ci-setup/​action.yml Centralizes .NET, Xcode, workload setup, and caching.

Review effort: Balanced

- '!build/.markdownlint.json'
pull_request:
branches: *branches
paths: *paths
run: |
$output = & build/ci/scripts/determine-test-scope.ps1 6>&1 | Out-String
Write-Host $output
$required = $output -match 'WebGpuTestsRequired requires tests: true'
Comment on lines +104 to +107
- uses: actions/download-artifact@v4
with:
name: native-assets-macos
path: src/Uno.UI.Runtime.MacOS/UnoNativeMac/build/Release
appEnvironment: 'UNO_WEBGPU=1 UNO_WEBGPU_LOG=warn'
# On pull requests only when they touch WebGPU or the test infrastructure (determine-test-scope.ps1).
condition: "and(succeeded(), or(ne(variables['Build.Reason'], 'PullRequest'), eq(stageDependencies.Setup.DetermineScope.outputs['SetScope.WebGpuTestsRequired'], 'true')))"
# The iOS and macOS desktop runtime tests run on GitHub Actions: .github/workflows/ci-macos.yml
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@Jen-Uno

Jen-Uno commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

On cost: I checked this PR's macOS CI run, and GitHub's billable time lists no macOS minutes, so the runners are free here, as you expected.

So the blocker is the one you named: 5 concurrent macOS jobs. #26067 has a piece that would help with that:

  • Run iOS on PRs only when they need it. ci(ios): Run one iOS test group on PRs without UIKit changes #26067 sets UIKitTestsRequired in determine-test-scope.ps1. The flag is set by:

    • iOS/tvOS paths;
    • the Apple toolchain files;
    • changed lines with iOS/tvOS code;
    • PRs into branches other than master;
    • a ci/run-ios label.

    ci-macos.yml already runs that script for WebGPU, so it could read the flag the same way and skip the iOS build and its 8 test jobs on most PRs. That frees most of the 5 slots for the PRs that need them.

  • The rerun limit doesn't matter here, since the minutes are free. Reruns still take slots, though, and a GitHub rerun repeats every test in the group, not just the failed ones.

If this PR is the way forward, I'll cut #26067 down to the scope-script changes so the two don't conflict.

@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants