From 8770a0f09b6fef3cb3395621eb645f336cce698d Mon Sep 17 00:00:00 2001 From: Anton Malygin Date: Wed, 20 May 2026 08:31:14 -0500 Subject: [PATCH 1/2] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3c06f6b..11c4bc1 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Also, you can create the own subclass of `StableCollectionViewLayout` and use it The preferred installation method is with [CocoaPods](https://cocoapods.org). Add the following to your `Podfile`: ```ruby -pod 'StableCollectionViewLayout', '~> 1.0.2' +pod 'StableCollectionViewLayout', '~> 1.0.3' ``` ### Carthage @@ -57,7 +57,7 @@ pod 'StableCollectionViewLayout', '~> 1.0.2' For [Carthage](https://github.com/Carthage/Carthage), add the following to your `Cartfile`: ```ogdl -github "aimalygin/StableCollectionViewLayout" ~> 1.0.2 +github "aimalygin/StableCollectionViewLayout" ~> 1.0.3 ``` ### Swift Package Manager @@ -70,4 +70,4 @@ To integrate using Xcode: File -> Swift Packages -> Add Package Dependency Enter package URL: https://github.com/aimalygin/StableCollectionViewLayout, and select the latest release. -``` \ No newline at end of file +``` From 7e18a2bafa2deaddbd16939145e09b8bc9b9b59f Mon Sep 17 00:00:00 2001 From: Anton Malygin Date: Wed, 20 May 2026 09:01:12 -0500 Subject: [PATCH 2/2] Update CI config --- .github/workflows/swift.yml | 10 +++---- Package.swift | 8 +++-- ci/test-ios.sh | 58 +++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 8 deletions(-) create mode 100755 ci/test-ios.sh diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index cda61a2..a802ecc 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -1,7 +1,7 @@ # This workflow will build a Swift project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift -name: Swift +name: iOS CI on: push: @@ -15,8 +15,6 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v3 - - name: Build - run: swift build -v - - name: Run tests - run: swift test -v + - uses: actions/checkout@v4 + - name: Build and test on iOS Simulator + run: bash ci/test-ios.sh diff --git a/Package.swift b/Package.swift index 6cbaf1a..06217db 100644 --- a/Package.swift +++ b/Package.swift @@ -5,6 +5,9 @@ import PackageDescription let package = Package( name: "StableCollectionViewLayout", + platforms: [ + .iOS(.v9), + ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( @@ -22,12 +25,13 @@ let package = Package( .target( name: "StableCollectionViewLayout", dependencies: [], - path: "StableCollectionViewLayout" + path: "StableCollectionViewLayout/Sources" ), .testTarget( name: "StableCollectionViewLayoutTests", dependencies: ["StableCollectionViewLayout"], - path: "StableCollectionViewLayoutTests" + path: "StableCollectionViewLayoutTests", + exclude: ["Info.plist"] ), ] ) diff --git a/ci/test-ios.sh b/ci/test-ios.sh new file mode 100755 index 0000000..ab3e291 --- /dev/null +++ b/ci/test-ios.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +set -euo pipefail + +PROJECT="${PROJECT:-StableCollectionViewLayout.xcodeproj}" +SCHEME="${SCHEME:-StableCollectionViewLayoutTests}" +DERIVED_DATA_PATH="${DERIVED_DATA_PATH:-${PWD}/DerivedData}" +DESTINATION_NAME="${DESTINATION_NAME:-}" + +if [[ -n "${DESTINATION_NAME}" ]]; then + DESTINATION="platform=iOS Simulator,name=${DESTINATION_NAME},OS=latest" +else + DESTINATION_ID="$( + xcrun simctl list devices available -j | /usr/bin/python3 -c ' +import json +import sys + +preferred_names = ( + "iPhone 17", + "iPhone 16", + "iPhone 15", + "iPhone 14", + "iPhone 13", + "iPhone 12", + "iPhone 11", +) +data = json.load(sys.stdin) +devices = [] + +for runtime, runtime_devices in data.get("devices", {}).items(): + if not runtime.startswith("com.apple.CoreSimulator.SimRuntime.iOS-"): + continue + + for device in runtime_devices: + if device.get("isAvailable"): + devices.append(device) + +for preferred_name in preferred_names: + for device in devices: + if device.get("name") == preferred_name: + print(device["udid"]) + sys.exit(0) + +if devices: + print(devices[0]["udid"]) + sys.exit(0) + +sys.exit("No available iOS simulator found") +' + )" + DESTINATION="id=${DESTINATION_ID}" +fi + +xcodebuild test \ + -project "${PROJECT}" \ + -scheme "${SCHEME}" \ + -destination "${DESTINATION}" \ + -derivedDataPath "${DERIVED_DATA_PATH}" \ + CODE_SIGNING_ALLOWED=NO