From 02fc0aeb988d6da1248b8f9f6ec7cd2c36d71014 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Jun 2026 11:21:45 +0100 Subject: [PATCH] Fix iOS CI build on macos-26/Xcode 26 runner (#483) * Fix iOS CI: use writable temp dir for DataStorePreferenceStore tests Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> * Run iOS workflow on this branch's pushes to test the CI fix Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> * Remove temporary feature-branch push trigger from iOS workflow Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> * Filter iOS/Android PR workflows to relevant changed paths Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> * Revert "Filter iOS/Android PR workflows to relevant changed paths" This reverts commit f32c120fa8c32f4d56e83603af0e5745d397a7b0. Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> * Fix iOS build: use StocksWidget scheme in xcodebuild Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> * Build iOS app against simulator SDK instead of unavailable simulator destination Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> * Build iOS app for generic device SDK (no simulator runtime on runner) Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> * Install iOS platform before building app in CI Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> * Pin named iPhone 17 simulator destination for iOS app build Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> * Condense iOS CI step comments Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com> --- .github/workflows/ios.yml | 15 ++++++++++----- .../settings/DataStorePreferenceStoreTest.kt | 7 ++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 56c85b08..54946b12 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -7,9 +7,6 @@ on: push: branches: - 'master' - # TEMPORARY: exercise the iOS pipeline on this feature branch before it - # is merged to master. Remove this line once the branch is merged. - - 'copilot/implement-phase-6' jobs: ios: @@ -72,10 +69,18 @@ jobs: run: | source ./version.sh xcodegen generate + - name: Install iOS platform + # The macos-26 image ships the iOS 26 SDK but not the iOS 26 platform + # support (simulator runtime), so xcodebuild destinations fail with + # "iOS 26.0 is not installed" until it is downloaded on demand. + run: sudo xcodebuild -downloadPlatform iOS - name: Build iOS app (simulator, no code signing) + # Pin a concrete named simulator device: on the arm64 runner it resolves + # to a single architecture (a generic destination did not). No OS is + # pinned, so an already-installed iPhone 17 runtime is used. run: | xcodebuild build \ -project iosApp/StockTicker.xcodeproj \ - -scheme iosApp \ - -destination 'generic/platform=iOS Simulator' \ + -scheme StocksWidget \ + -destination 'platform=iOS Simulator,name=iPhone 17' \ CODE_SIGNING_ALLOWED=NO diff --git a/shared/src/commonTest/kotlin/com/github/premnirmal/ticker/settings/DataStorePreferenceStoreTest.kt b/shared/src/commonTest/kotlin/com/github/premnirmal/ticker/settings/DataStorePreferenceStoreTest.kt index 24ed8f03..17cddff4 100644 --- a/shared/src/commonTest/kotlin/com/github/premnirmal/ticker/settings/DataStorePreferenceStoreTest.kt +++ b/shared/src/commonTest/kotlin/com/github/premnirmal/ticker/settings/DataStorePreferenceStoreTest.kt @@ -1,5 +1,6 @@ package com.github.premnirmal.ticker.settings +import okio.FileSystem import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNull @@ -8,7 +9,11 @@ import kotlin.test.assertTrue class DataStorePreferenceStoreTest { private fun newStore(): PreferenceStore { - val path = "build/test-datastore/prefs-${kotlin.random.Random.nextInt()}.preferences_pb" + // Use an absolute path under the system temporary directory. A relative path is not + // writable from the iOS simulator's working directory and makes DataStore throw. + val dir = FileSystem.SYSTEM_TEMPORARY_DIRECTORY / "stockticker-test-datastore" + FileSystem.SYSTEM.createDirectories(dir) + val path = (dir / "prefs-${kotlin.random.Random.nextInt()}.preferences_pb").toString() return DataStorePreferenceStore(createPreferenceDataStore { path }) }