From e5bc6bcae6836218295377771bc5d9fbc5bce57e Mon Sep 17 00:00:00 2001 From: Tim Oliver Date: Mon, 6 Oct 2025 08:21:43 -0700 Subject: [PATCH] Remove using CocoaPods to build IGListKit's test suite (#1641) Summary: ## Changes in this pull request [As was announced in late 2024](https://blog.cocoapods.org/CocoaPods-Specs-Repo/), CocoaPods will be eventually sunset with the tentative end date being at the end of 2026. While we had already migrated all of IGListKit's sample apps to use SPM, the main Xcode project was still relying on CocoaPods to import OCMock as a dependency of running its test suite. In order to get ahead of this eventual shut down, this PR completely removes CocoaPods as a dependency of running any of the projects in this repo and moves OCMock over to an SPM import. This ends up actually being a better experience since now, all anyone needs to do is open `IGListKit.xcodeproj` without needing to run anything beforehand, and Xcode will automatically handle the rest. Please note this doesn't remove IGListKit from CocoaPods itself. IGListKit will still be available as a CocoaPods dependency. ### Checklist - [x] All tests pass. Demo project builds and runs. - [x] I added tests, an experiment, or detailed why my change isn't tested. - [ ] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes. - [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/main/.github/CONTRIBUTING.md) Pull Request resolved: https://github.com/instagram/IGListKit/pull/1641 Test Plan: All GitHub pipelines still working: {F1982500959} Reviewed By: fabiomassimo Differential Revision: D83946914 Pulled By: TimOliver fbshipit-source-id: 3542451379b57c87c88fc95684fb3595a09c8fd6 --- .github/workflows/CI.yml | 68 ++++++++++++----------------- CHANGELOG.md | 2 + Gemfile | 2 +- IGListKit.xcodeproj/project.pbxproj | 54 +++++++++++++++++++---- Podfile | 15 ------- 5 files changed, 78 insertions(+), 63 deletions(-) delete mode 100644 Podfile diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f3a44cba..82ed8d5e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,10 +11,10 @@ on: jobs: macOS: name: Unit Test macOS - runs-on: macos-13 + runs-on: macos-26 env: - DEVELOPER_DIR: /Applications/Xcode_14.3.app - WORKSPACE_NAME: IGListKit.xcworkspace + DEVELOPER_DIR: /Applications/Xcode.app + PROJECT_NAME: IGListKit.xcodeproj SCHEME_NAME: IGListKit-macOS steps: - name: Checkout @@ -31,25 +31,22 @@ jobs: - name: Install ruby gems. run: bundle install - - name: Install pods. - run: pod install - - name: Run unit tests for macOS run: | set -o pipefail - xcodebuild build build-for-testing -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -destination "platform=macOS" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | bundle exec xcpretty -c - xcodebuild analyze test-without-building -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -destination "platform=macOS" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | bundle exec xcpretty -c + xcodebuild build build-for-testing -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -destination "platform=macOS" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | bundle exec xcpretty -c + xcodebuild analyze test-without-building -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -destination "platform=macOS" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | bundle exec xcpretty -c iOS: name: Unit Test iOS - runs-on: macos-13 + runs-on: macos-26 env: - DEVELOPER_DIR: /Applications/Xcode_14.3.app - WORKSPACE_NAME: IGListKit.xcworkspace + DEVELOPER_DIR: /Applications/Xcode.app + PROJECT_NAME: IGListKit.xcodeproj SCHEME_NAME: IGListKit strategy: matrix: - destination: ["platform=iOS Simulator,name=iPhone 14 Pro"] + destination: ["platform=iOS Simulator,name=iPhone Air,OS=26.0"] steps: - name: Checkout uses: actions/checkout@v3 @@ -65,14 +62,11 @@ jobs: - name: Install ruby gems. run: bundle install - - name: Install pods. - run: pod install - - name: iOS - ${{ matrix.destination }} run: | set -o pipefail - xcodebuild build build-for-testing -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -destination "${{ matrix.destination }}" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | bundle exec xcpretty -c - xcodebuild analyze test-without-building -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -destination "${{ matrix.destination }}" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | bundle exec xcpretty -c + xcodebuild build build-for-testing -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -destination "${{ matrix.destination }}" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | bundle exec xcpretty -c + xcodebuild analyze test-without-building -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -destination "${{ matrix.destination }}" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | bundle exec xcpretty -c - name: Upload code coverage run: bundle exec slather @@ -83,9 +77,9 @@ jobs: CocoaPods: name: CocoaPods Lint - runs-on: macos-13 + runs-on: macos-26 env: - DEVELOPER_DIR: /Applications/Xcode_14.3.app + DEVELOPER_DIR: /Applications/Xcode.app steps: - name: Checkout uses: actions/checkout@v3 @@ -112,12 +106,11 @@ jobs: SPM-layout-generator: name: Verify generate_spm_sources_layout.sh is not broken - runs-on: macos-13 + runs-on: macos-26 env: - DEVELOPER_DIR: /Applications/Xcode_14.3.app - WORKSPACE_NAME: IGListKit.xcworkspace + DEVELOPER_DIR: /Applications/Xcode.app PROJECT_NAME: IGListKit.xcodeproj - IOS_DESTINATION: "platform=iOS Simulator,name=iPhone 14 Pro" + IOS_DESTINATION: "platform=iOS Simulator,name=iPhone Air,OS=26.0" SPM_IG_LIST_DIFF_KIT_PUBLIC_HEADERS_PATH: "spm/Sources/IGListDiffKit/include" SPM_IG_LIST_DIFF_KIT_SOURCES_PATH: "spm/Sources/IGListDiffKit" SPM_IG_LIST_KIT_PUBLIC_HEADERS_PATH: "spm/Sources/IGListKit/include" @@ -136,9 +129,8 @@ jobs: - name: Regenerate SPM layout run: sh scripts/generate_spm_sources_layout.sh - - name: Clean project's ${{ env.PROJECT_NAME }} and ${{ env.WORKSPACE_NAME }} + - name: Clean project's ${{ env.PROJECT_NAME }} run: | - rm -rf "${{ env.WORKSPACE_NAME }}" rm -rf "${{ env.PROJECT_NAME }}" - name: Verify IGListKit can be build using Package.swift which was generated by 'scripts/generate_spm_sources_layout.sh' @@ -146,12 +138,11 @@ jobs: SPM-build-from-Package: name: Verify SPM build by invoking `xcodebuild` on Package.swift - runs-on: macos-13 + runs-on: macos-26 env: - DEVELOPER_DIR: /Applications/Xcode_14.3.app - WORKSPACE_NAME: IGListKit.xcworkspace + DEVELOPER_DIR: /Applications/Xcode.app PROJECT_NAME: IGListKit.xcodeproj - IOS_DESTINATION: "platform=iOS Simulator,name=iPhone 14 Pro" + IOS_DESTINATION: "platform=iOS Simulator,name=iPhone Air,OS=26.0" strategy: matrix: schemeName: ["IGListDiffKit", @@ -161,9 +152,8 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Clean project's ${{ env.PROJECT_NAME }} and ${{ env.WORKSPACE_NAME }} + - name: Clean project's ${{ env.PROJECT_NAME }} run: | - rm -rf "${{ env.WORKSPACE_NAME }}" rm -rf "${{ env.PROJECT_NAME }}" - name: Run ${{ matrix.schemeName}} using Package.swift @@ -171,9 +161,9 @@ jobs: Carthage-XCFramework: name: Verify Carthage build XCFramework - runs-on: macos-13 + runs-on: macos-26 env: - DEVELOPER_DIR: /Applications/Xcode_14.3.app + DEVELOPER_DIR: /Applications/Xcode.app steps: - name: Checkout uses: actions/checkout@v3 @@ -183,16 +173,16 @@ jobs: Build-Examples: name: Build Examples and UI tests. - runs-on: macos-13 + runs-on: macos-26 env: - DEVELOPER_DIR: /Applications/Xcode_14.3.app + DEVELOPER_DIR: /Applications/Xcode.app IOS_EXAMPLE_XCODEPROJ: Examples/Examples-iOS/IGListKitExamples.xcodeproj TVOS_EXAMPLE_XCODEPROJ: Examples/Examples-tvOS/IGListKitExamples.xcodeproj MACOS_EXAMPLE_XCODEPROJ: Examples/Examples-macOS/IGListKitExamples.xcodeproj EXAMPLE_SCHEME: IGListKitExamples strategy: matrix: - iosDestination: ["platform=iOS Simulator,name=iPhone 14 Pro,OS=16.4"] + iosDestination: ["platform=iOS Simulator,name=iPhone Air,OS=26.0"] tvOSDestination: ["platform=tvOS Simulator,name=Apple TV 4K (3rd generation)"] macOSDestination: ["platform=macOS"] macCatalystDestination: ["platform=macOS,variant=Mac Catalyst"] @@ -214,8 +204,8 @@ jobs: - name: Preboot iOS Simulator uses: futureware-tech/simulator-action@v2 with: - model: 'iPhone 14 Pro' - os_version: '=16.4' + model: 'iPhone Air' + os_version: '=26.0' - name: Build iOS Example - ${{ matrix.iosDestination }} run: | @@ -245,7 +235,7 @@ jobs: Danger: name: Run Danger if: github.event_name == 'pull_request' - runs-on: macos-13 + runs-on: macos-26 env: DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index c28d88d1..e185eec8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ The changelog for `IGListKit`. Also see the [releases](https://github.com/instag ### Enhancements +- Replaced CocoaPods with SPM as the new dependency manager of `IGListKit.xcodeproj` when running unit tests. [Tim Oliver](https://github.com/timoliver) [(2964f06)](https://github.com/Instagram/IGListKit/commit/2964f066a3b0ad533f2eeda71096caeb0b54500a) + - Added handling for new collection view cell dequeue behavior in iOS 18 [Maxime Ollivier](https://github.com/maxolls) [(4bad7d52)](https://github.com/Instagram/IGListKit/commit/4bad7d52604c695e48c0c161fed631aad8511449) - Added support for Swift Concurrency [Mark Davis](https://instagram.com/m4rk) [(0ec2d52)](https://github.com/Instagram/IGListKit/commit/0ec2d526f35374dc0366024f8bb62aac4db1fd8d) diff --git a/Gemfile b/Gemfile index 036e5ce0..b546cea5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'cocoapods', '~> 1.14.2' +gem 'cocoapods', '~> 1.16.2' gem 'danger', '~> 9.3.1' gem 'danger-swiftlint', '~> 0.33.0' gem 'slather', '~> 2.7.4' diff --git a/IGListKit.xcodeproj/project.pbxproj b/IGListKit.xcodeproj/project.pbxproj index 35b5fe73..b5e33ce8 100644 --- a/IGListKit.xcodeproj/project.pbxproj +++ b/IGListKit.xcodeproj/project.pbxproj @@ -448,6 +448,9 @@ F10C8F582B982EE7009F4690 /* IGListDefaultExperiments.h in Headers */ = {isa = PBXBuildFile; fileRef = F10C8F562B982DFD009F4690 /* IGListDefaultExperiments.h */; }; F10C8F5B2B9830F0009F4690 /* IGListTestCollectionViewLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F10C8F592B9830E6009F4690 /* IGListTestCollectionViewLayout.m */; }; F10C8F5C2B9830F1009F4690 /* IGListTestCollectionViewLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F10C8F592B9830E6009F4690 /* IGListTestCollectionViewLayout.m */; }; + F12D8EAA2E93852600A7DDBE /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = F12D8EA92E93852600A7DDBE /* OCMock */; }; + F12D8EAC2E93853500A7DDBE /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = F12D8EAB2E93853500A7DDBE /* OCMock */; }; + F12D8EAF2E93854100A7DDBE /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = F12D8EAE2E93854100A7DDBE /* OCMock */; }; F15DB2F12D813B090066C7AD /* IGListAdapter+Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = F15DB2EC2D813B090066C7AD /* IGListAdapter+Async.swift */; }; F15DB2F22D813B090066C7AD /* ListValueSectionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F15DB2F02D813B090066C7AD /* ListValueSectionController.swift */; }; F15DB2F32D813B090066C7AD /* IGListSingleSectionController+Refinements.swift in Sources */ = {isa = PBXBuildFile; fileRef = F15DB2EE2D813B090066C7AD /* IGListSingleSectionController+Refinements.swift */; }; @@ -962,6 +965,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F12D8EAC2E93853500A7DDBE /* OCMock in Frameworks */, 885FE1DD1DC51A0D009CE2B4 /* IGListKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -978,6 +982,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F12D8EAA2E93852600A7DDBE /* OCMock in Frameworks */, 887D0B401D870D7F009E01F7 /* IGListKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -986,6 +991,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F12D8EAF2E93854100A7DDBE /* OCMock in Frameworks */, 88DF89811E010E6A00B1B9B4 /* IGListKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1012,13 +1018,6 @@ path = Source; sourceTree = ""; }; - 15D054C1829CB3E2E2196A55 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - path = Pods; - sourceTree = ""; - }; 294369AF1DB1B7AE0025F6E7 /* Assets */ = { isa = PBXGroup; children = ( @@ -1303,7 +1302,6 @@ children = ( 0B3B927E1E08D7F5008390ED /* Source */, 887D0B551D870E1E009E01F7 /* Tests */, - 15D054C1829CB3E2E2196A55 /* Pods */, 887D0B371D870D7E009E01F7 /* Products */, F15F1DDD2BA40BC9002AF3FE /* IGListDiffKit.podspec */, F15F1DDC2BA40BC9002AF3FE /* IGListKit.podspec */, @@ -1312,6 +1310,7 @@ F14291E62D83FA0A007D3437 /* README.md */, F14291E72D83FA0A007D3437 /* README.zh.md */, F1E6581B2D83FEC100989232 /* CHANGELOG.md */, + F12D8EAD2E93854100A7DDBE /* Frameworks */, ); sourceTree = ""; usesTabs = 0; @@ -1379,6 +1378,13 @@ path = Tests; sourceTree = ""; }; + F12D8EAD2E93854100A7DDBE /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -1921,6 +1927,9 @@ Base, ); mainGroup = 887D0B2C1D870D7E009E01F7; + packageReferences = ( + F12D8EA82E93852600A7DDBE /* XCRemoteSwiftPackageReference "ocmock" */, + ); productRefGroup = 887D0B371D870D7E009E01F7 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -3642,6 +3651,35 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + F12D8EA82E93852600A7DDBE /* XCRemoteSwiftPackageReference "ocmock" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/erikdoe/ocmock.git"; + requirement = { + branch = master; + kind = branch; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + F12D8EA92E93852600A7DDBE /* OCMock */ = { + isa = XCSwiftPackageProductDependency; + package = F12D8EA82E93852600A7DDBE /* XCRemoteSwiftPackageReference "ocmock" */; + productName = OCMock; + }; + F12D8EAB2E93853500A7DDBE /* OCMock */ = { + isa = XCSwiftPackageProductDependency; + package = F12D8EA82E93852600A7DDBE /* XCRemoteSwiftPackageReference "ocmock" */; + productName = OCMock; + }; + F12D8EAE2E93854100A7DDBE /* OCMock */ = { + isa = XCSwiftPackageProductDependency; + package = F12D8EA82E93852600A7DDBE /* XCRemoteSwiftPackageReference "ocmock" */; + productName = OCMock; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 887D0B2D1D870D7E009E01F7 /* Project object */; } diff --git a/Podfile b/Podfile deleted file mode 100644 index efaf139e..00000000 --- a/Podfile +++ /dev/null @@ -1,15 +0,0 @@ -source 'https://cdn.cocoapods.org' -use_frameworks! -inhibit_all_warnings! - -workspace 'IGListKit' - -target 'IGListKitTests' do - platform :ios, '11.0' - pod 'OCMock', '~> 3.8.1' -end - -target 'IGListKit-tvOSTests' do - platform :tvos, '11.0' - pod 'OCMock', '~> 3.8.1' -end