Improve the CI harness - #159
Conversation
- Extract the duplicated simulator-selection script from the package and example jobs into a local composite action (.github/actions/select-simulator) with the same download-and-retry behavior. - Give every job an explicit timeout so a hung simulator or runner cannot burn the full six-hour default. - Collect code coverage in the package test job and publish a per-target line-coverage table to the job summary. - Restrict the test workflow's token to contents: read; it only checks out the repository. - Add a Dependabot config that keeps the GitHub Actions up to date with a weekly grouped PR. Job names are unchanged, so the required status checks on main are unaffected.
The review action validates that its workflow file matches the default branch and skips the review otherwise, so the timeout for that job moves to its own change.
| name: Package tests (iOS Simulator) | ||
| runs-on: macos-26 | ||
| timeout-minutes: 30 | ||
| steps: |
There was a problem hiding this comment.
Minor: if the simulator isn't preinstalled, the fallback in select-simulator runs sudo xcodebuild -downloadPlatform iOS, which can itself take a while — combined with the actual test run, this could occasionally bump into the new 30-minute cap on a cold runner. Not a blocker since this is a rare fallback path, just something to watch if CI starts timing out intermittently.
There was a problem hiding this comment.
Solid CI maintenance PR: dedupes the simulator-selection script into a reusable composite action (behavior preserved, now with set -euo pipefail for stricter error handling), adds per-job timeouts, restricts the test workflow's token to contents: read, adds a code-coverage summary via xccov, and sets up Dependabot for Actions. No functional/Swift code is touched; the workflow logic is correct and the composite action faithfully reproduces the original inline script. Left one non-blocking inline note about a possible edge case with the new 30-minute timeout when the iOS platform download fallback triggers.
If no iPhone simulator is preinstalled, the selection step downloads the iOS platform first, which can take a large share of a 30-minute budget on a cold runner. 45 minutes keeps the guard against hung jobs while leaving room for that rare path.
|
Good catch on the download fallback — bumped the two simulator jobs to 45 minutes so the rare |
Summary
Maintenance pass over the GitHub Actions setup. Job names are unchanged, so the required status checks on
main("Package tests (iOS Simulator)", "Example app build", "Documentation build") are unaffected..github/actions/select-simulator, with the same behavior (first available iPhone simulator, downloading the iOS platform once if none is installed, hard error otherwise).timeout-minuteson every job (test 30 / example 30 / docc 20 / pages deploy 30 / review 20), so a hung simulator or runner cannot burn the six-hour default. Observed runs take 1–5 minutes.-enableCodeCoverage YESand appends a per-target line-coverage table to$GITHUB_STEP_SUMMARYviaxccov(currently ~90% for the library target; test bundles are filtered out as noise).permissions: contents: read) — it only checks out the repository.github-actionsecosystem, weekly, grouped into a single PR.Verification
xcodebuild test -enableCodeCoverage YES -resultBundlePath …+xccov … | jq) was run locally against Xcode 26.5 and produces the expected table.