summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-15 19:33:30 -0500
committerChristian Cleberg <[email protected]>2026-07-15 19:33:30 -0500
commit33bc142df56011877a9c85118eb4df63fd9ca3aa (patch)
tree3d86d992a27df7a63085ea0e23a124d978e29cb3
parenteff81f34bb51ecc6e0aa5d831567db2cea0527a9 (diff)
downloadhutch-33bc142df56011877a9c85118eb4df63fd9ca3aa.tar.gz
hutch-33bc142df56011877a9c85118eb4df63fd9ca3aa.tar.bz2
hutch-33bc142df56011877a9c85118eb4df63fd9ca3aa.zip
ci: run the test plan on macOS
The builds.sr.ht job runs on Ubuntu and can only do secret scanning and structure checks, so the 214 tests ran only when someone remembered to run them in Xcode. That is why the suite had rotted to ten failures. builds.sr.ht has no macOS image and its maintainer has ruled them out, so xcodebuild cannot run there. Add a job on the GitHub mirror instead. Pinned to macos-26 because macos-latest still points at macOS 15, which lacks the iOS 26 SDK. The simulator is resolved at runtime rather than pinned by name, since device names shift between runner images.
-rw-r--r--.github/workflows/test.yml60
1 files changed, 60 insertions, 0 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..568ff39
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,60 @@
+name: Tests
+
+# builds.sr.ht is the canonical CI for this project, but it has no macOS images
+# and will not add them, so xcodebuild cannot run there. This job exists to run
+# the test plan on the GitHub mirror; see builds/swift-ci.yml for the rest.
+on:
+ push:
+ branches: [main]
+ pull_request:
+ workflow_dispatch:
+
+concurrency:
+ group: tests-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test:
+ name: xcodebuild test
+ # macos-latest still points at macOS 15, which lacks the iOS 26 SDK.
+ runs-on: macos-26
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Show toolchain
+ run: |
+ xcodebuild -version
+ swift --version
+
+ - name: Select simulator
+ id: sim
+ run: |
+ set -euo pipefail
+ udid=$(xcrun simctl list devices available --json \
+ | jq -r '[.devices[][] | select(.name | startswith("iPhone"))] | first | .udid')
+ if [ -z "$udid" ] || [ "$udid" = "null" ]; then
+ echo "No available iPhone simulator on this image" >&2
+ xcrun simctl list devices available >&2
+ exit 1
+ fi
+ echo "udid=$udid" >> "$GITHUB_OUTPUT"
+
+ - name: Test
+ run: |
+ set -o pipefail
+ xcodebuild test \
+ -project Hutch.xcodeproj \
+ -scheme Hutch \
+ -testPlan HutchTests \
+ -destination "id=${{ steps.sim.outputs.udid }}" \
+ -resultBundlePath TestResults.xcresult \
+ CODE_SIGNING_ALLOWED=NO
+
+ - name: Upload results
+ if: failure()
+ uses: actions/upload-artifact@v4
+ with:
+ name: test-results
+ path: TestResults.xcresult
+ retention-days: 7