You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ed9d424
Browse filesBrowse the repository at this point in the historyBrowse files
description: Debug and fix failing GitHub Actions workflows (CI) in this repo — failing PR checks, xcodebuild/simulator/runner-image errors, SwiftLint failures. Use when asked to review, debug, or fix CI or a failing workflow run.
7
+
---
8
+
9
+
# Debugging failing GitHub Actions workflows
10
+
11
+
Workflows live in `.github/workflows/`:
12
+
13
+
-`xcode.yml` — builds the `Nextcloud` scheme for testing, then runs tests on a simulator against a locally installed Nextcloud server. Version pins are env vars at the top: `XCODE_VERSION`, `DESTINATION`, plus the `runs-on` labels and the `simctl boot` device name further down.
14
+
-`additional-targets.yml` — builds the extension schemes (Share, File Provider, Notification Service, Widget, WidgetDashboardIntentHandler). Keep its image/Xcode/destination consistent with `xcode.yml`.
15
+
-`lint.yml` — SwiftLint on ubuntu.
16
+
17
+
## 1. Get the failure
18
+
19
+
Use the `gh` CLI (if a GitHub MCP server is connected, its equivalents like `list_workflow_runs` / `get_job_logs` work too):
20
+
21
+
-`gh pr checks <pr>` or `gh run list --branch <branch> --limit 10` — find failing runs
22
+
-`gh run view <run-id>` — see which jobs and steps failed
23
+
-`gh run view <run-id> --log-failed | grep -iE "error:|failed" | head -60` — never dump full logs into context; grep/tail them, or have a subagent read them and report only the failing step and error lines.
24
+
25
+
## 2. Classify before fixing
26
+
27
+
-`cannot find type '…' in scope` for Apple APIs → SDK mismatch: the code uses APIs newer than the SDK of the Xcode selected on the runner. Confirm the API's introduction version by grepping the local SDK, e.g.
- "Unable to find a destination" or simulator boot errors → the pinned `DESTINATION` OS/device or the `simctl boot` device name doesn't exist on the runner image.
31
+
- Job queued forever or tooling missing → invalid or stale `runs-on` label.
32
+
- Test-job failures around PHP/occ → the Nextcloud server setup steps; these shell steps can be reproduced locally.
33
+
- SwiftLint failures → run `swiftlint` locally.
34
+
35
+
## 3. Check runner-image compatibility
36
+
37
+
Before changing any pin, check https://github.com/actions/runner-images:
38
+
39
+
- The README's Available Images table has the valid `runs-on` labels, including preview images (e.g. `xcode-27`) and deprecation notices.
40
+
- Each macOS image readme (`images/macos/<image>-arm64-Readme.md`) lists installed Xcode versions, iOS simulator runtimes, and device types.
41
+
42
+
The chosen combination must exist together on one image: `runs-on` label ↔ `XCODE_VERSION` ↔ `DESTINATION` OS + device ↔ `simctl boot` device name. New Xcode majors appear first on a dedicated preview image before reaching the GA `macos-NN` image.
43
+
44
+
## 4. Reproduce and fix
45
+
46
+
- Do **not** run `xcodebuild` locally to reproduce — builds take too long (repo rule). Reproduce only cheap failures (SwiftLint, YAML, shell steps); for compile/SDK failures, reason from the logs plus the SDK check above.
47
+
- Apply the fix to every workflow sharing the stale value.
- If you reproduced a failure locally, verify the fix locally before committing. Otherwise say plainly that verification needs a CI run; after pushing, watch it with `gh pr checks --watch` or `gh run watch`.
0 commit comments