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>
This commit is contained in:
co-authored by
copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
premnirmal
parent
22b3166136
commit
02fc0aeb98
@@ -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
|
||||
|
||||
+6
-1
@@ -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 })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user