From 1b01d55255e6fd6f6761b566730b39206396c768 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 15:44:54 +0000 Subject: [PATCH 1/3] ci: build with the newest Xcode on macos-26 main has failed CI since Nov 4: the widget uses WidgetFamily.systemExtraLargePortrait (macOS 27 SDK), which Xcode 16.4 on the macos-15 runner doesn't have. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f901215..6e318d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,9 @@ concurrency: jobs: test: name: Build & Test - runs-on: macos-15 + # The app uses macOS 27 SDK symbols (the extra-large portrait widget + # size), so CI needs the newest Xcode, not macos-15's default 16.4. + runs-on: macos-26 timeout-minutes: 20 env: @@ -28,6 +30,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Select newest Xcode + run: | + XCODE=$(ls -d /Applications/Xcode_*.app | grep -vi beta | sort -V | tail -1) + echo "Using $XCODE" + sudo xcode-select -s "$XCODE/Contents/Developer" + - name: Show Xcode version run: xcodebuild -version From ae1c6d75b31fa10fbfd4d7312f195ddd1be9c844 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 15:52:38 +0000 Subject: [PATCH 2/3] fix(widgets): leave out extra-large portrait on pre-macOS 27 SDKs The newest hosted runner Xcode (26.6, macOS 26.5 SDK) marks WidgetFamily.systemExtraLargePortrait unavailable on macOS, and Xcode 16 doesn't have it at all. Builds with those SDKs now skip the size via a PRE_MACOS27_SDK condition set in project.yml; macOS 27 SDK builds keep it. CI also prints the Swift version. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 4 +++- TokenomicsWidgets/TokenomicsWidgetEntryView.swift | 2 ++ TokenomicsWidgets/TokenomicsWidgets.swift | 2 ++ project.yml | 5 +++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e318d2..7924b06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,9 @@ jobs: sudo xcode-select -s "$XCODE/Contents/Developer" - name: Show Xcode version - run: xcodebuild -version + run: | + xcodebuild -version + swift --version - name: Install xcodegen run: brew install xcodegen diff --git a/TokenomicsWidgets/TokenomicsWidgetEntryView.swift b/TokenomicsWidgets/TokenomicsWidgetEntryView.swift index d03593d..4806f96 100644 --- a/TokenomicsWidgets/TokenomicsWidgetEntryView.swift +++ b/TokenomicsWidgets/TokenomicsWidgetEntryView.swift @@ -136,9 +136,11 @@ struct TokenomicsWidgetEntryView: View { MediumWidgetView(entry: entry) case .systemLarge: LargeWidgetView(entry: entry) + #if !PRE_MACOS27_SDK case .systemExtraLargePortrait: // Same layout as large, with room for every pool instead of "+N in app". LargeWidgetView(entry: entry, maxRows: 14) + #endif default: MediumWidgetView(entry: entry) } diff --git a/TokenomicsWidgets/TokenomicsWidgets.swift b/TokenomicsWidgets/TokenomicsWidgets.swift index 2e4b75d..021563d 100644 --- a/TokenomicsWidgets/TokenomicsWidgets.swift +++ b/TokenomicsWidgets/TokenomicsWidgets.swift @@ -54,9 +54,11 @@ struct TokenomicsWidget: Widget { /// Extra-large portrait (a tall column) arrived in macOS 27. private static var families: [WidgetFamily] { var families: [WidgetFamily] = [.systemSmall, .systemMedium, .systemLarge] + #if !PRE_MACOS27_SDK if #available(macOS 27.0, *) { families.append(.systemExtraLargePortrait) } + #endif return families } diff --git a/project.yml b/project.yml index 1c28f6c..f92baed 100644 --- a/project.yml +++ b/project.yml @@ -182,6 +182,11 @@ targets: SWIFT_STRICT_CONCURRENCY: complete MACOSX_DEPLOYMENT_TARGET: "14.0" SWIFT_ACTIVE_COMPILATION_CONDITIONS: "$(inherited) WIDGET_EXTENSION" + # The extra-large portrait widget size needs the macOS 27 SDK. Older + # SDKs (Xcode 16 and 26, e.g. on CI) either lack it or mark it + # unavailable on macOS, so those builds leave it out. + "SWIFT_ACTIVE_COMPILATION_CONDITIONS[sdk=macosx15*]": "$(inherited) WIDGET_EXTENSION PRE_MACOS27_SDK" + "SWIFT_ACTIVE_COMPILATION_CONDITIONS[sdk=macosx26*]": "$(inherited) WIDGET_EXTENSION PRE_MACOS27_SDK" LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks" configs: debug: From b709d841aabe250a9ea5aeaa752cfc66018f2033 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 16:25:19 +0000 Subject: [PATCH 3/3] test: make weekday tests time-zone independent; time out hung tests in CI - distantFuture is Sunday evening in US time zones but Monday in UTC (CI), so the two 'isTheBugThisFixPrevents' tests now compare against the local weekday instead of a hard-coded Sunday. - CI gives each test a 60s allowance so a hang fails by name instead of running out the 20-minute job timeout. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 12 ++++++++++-- TokenomicsTests/WidgetWindowEntryTests.swift | 8 ++++++-- TokenomicsTests/WindowUsageTests.swift | 8 ++++++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7924b06..d0ab8e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,12 @@ jobs: CODE_SIGN_IDENTITY=- CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO + # A hung test fails by name after a minute instead of eating the + # whole job timeout with no clue which test it was. + TEST_TIMEOUT_FLAGS: >- + -test-timeouts-enabled YES + -default-test-execution-time-allowance 60 + -maximum-test-execution-time-allowance 120 steps: - name: Checkout @@ -62,7 +68,8 @@ jobs: -project Tokenomics.xcodeproj \ -scheme Tokenomics \ -destination 'platform=macOS' \ - $XCODEBUILD_FLAGS + $XCODEBUILD_FLAGS \ + $TEST_TIMEOUT_FLAGS # Widget-sync tests use a temp file (no App Group entitlement needed), # so they run in CI alongside NotificationPostingTests. Set repository variable @@ -74,4 +81,5 @@ jobs: -project Tokenomics.xcodeproj \ -scheme TokenomicsIntegration \ -destination 'platform=macOS' \ - $XCODEBUILD_FLAGS + $XCODEBUILD_FLAGS \ + $TEST_TIMEOUT_FLAGS diff --git a/TokenomicsTests/WidgetWindowEntryTests.swift b/TokenomicsTests/WidgetWindowEntryTests.swift index 316abe9..7332103 100644 --- a/TokenomicsTests/WidgetWindowEntryTests.swift +++ b/TokenomicsTests/WidgetWindowEntryTests.swift @@ -57,8 +57,12 @@ final class WidgetWindowEntryTests: XCTestCase { resetsAt: .distantFuture, windowDuration: 5 * 3600 ) - XCTAssertEqual(window.shortTimeUntilReset, "Sun", - "distantFuture's abbreviated weekday is Sun — why every nil-resetsAt window must set sublabelOverride") + // distantFuture's weekday depends on the time zone (Sun in US zones, + // Mon in UTC as on CI), so compare against the local weekday. + let weekday = DateFormatter() + weekday.dateFormat = "EEE" + XCTAssertEqual(window.shortTimeUntilReset, weekday.string(from: .distantFuture), + "distantFuture leaks an abbreviated weekday — why every nil-resetsAt window must set sublabelOverride") } /// With the override, shortTimeUntilReset returns it verbatim — no countdown diff --git a/TokenomicsTests/WindowUsageTests.swift b/TokenomicsTests/WindowUsageTests.swift index d8db975..6346e8e 100644 --- a/TokenomicsTests/WindowUsageTests.swift +++ b/TokenomicsTests/WindowUsageTests.swift @@ -52,8 +52,12 @@ final class WindowUsageTests: XCTestCase { resetsAt: .distantFuture, windowDuration: 5 * 3600 ) - XCTAssertEqual(window.timeUntilReset, "Resets Sunday", - "distantFuture formats as Sunday — this is why every nil-resetsAt window must set sublabelOverride") + // distantFuture's weekday depends on the time zone (Sunday in US zones, + // Monday in UTC as on CI), so compare against the local weekday. + let weekday = DateFormatter() + weekday.dateFormat = "EEEE" + XCTAssertEqual(window.timeUntilReset, "Resets \(weekday.string(from: .distantFuture))", + "distantFuture formats as a weekday — this is why every nil-resetsAt window must set sublabelOverride") } /// With the override in place, no weekday name can leak into the sublabel —