Skip to content

Improve the CI harness - #159

Merged
yysskk merged 3 commits into
mainfrom
ci/harness-improvements
Jul 7, 2026
Merged

Improve the CI harness#159
yysskk merged 3 commits into
mainfrom
ci/harness-improvements

Conversation

@yysskk

@yysskk yysskk commented Jul 7, 2026

Copy link
Copy Markdown
Owner

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.

  • Deduplicate the simulator selection. The identical "Select simulator" script in the package and example jobs now lives in a local composite action, .github/actions/select-simulator, with the same behavior (first available iPhone simulator, downloading the iOS platform once if none is installed, hard error otherwise).
  • Explicit timeout-minutes on 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.
  • Code coverage in the job summary. The package test job now runs with -enableCodeCoverage YES and appends a per-target line-coverage table to $GITHUB_STEP_SUMMARY via xccov (currently ~90% for the library target; test bundles are filtered out as noise).
  • Least-privilege token for the test workflow (permissions: contents: read) — it only checks out the repository.
  • Dependabot for the github-actions ecosystem, weekly, grouped into a single PR.

Verification

  • All workflow/action YAML parses cleanly.
  • The exact coverage pipeline (xcodebuild test -enableCodeCoverage YES -resultBundlePath … + xccov … | jq) was run locally against Xcode 26.5 and produces the expected table.
  • This PR's own CI run exercises the composite action in both jobs and the coverage summary step.

yysskk added 2 commits July 7, 2026 06:35
- 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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.
@yysskk

yysskk commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

Good catch on the download fallback — bumped the two simulator jobs to 45 minutes so the rare -downloadPlatform iOS path has headroom while still guarding against hung jobs.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The 30→45 minute timeout bump for the two simulator jobs addresses my earlier feedback about the platform-download fallback eating into the budget. No other changes since my last review; still LGTM.

@yysskk
yysskk merged commit d9bf787 into main Jul 7, 2026
4 checks passed
@yysskk
yysskk deleted the ci/harness-improvements branch July 7, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant