-
Couldn't load subscription status.
- Fork 146
Fix CI Failures and Improve Test Code #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
55d468d
5de301f
074869e
e4afefa
2936dd5
8873478
0094cb7
2c48e96
bc1b1b1
8502ef7
4ec55df
8b1af46
db4fde9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,68 +1,160 @@ | ||
| name: Run CI | ||
| on: [push, pull_request] | ||
|
|
||
| env: | ||
| XCODE_VERSION: "16.4.0" | ||
| IOS_SIMULATOR_DEVICE: "iPhone 16" | ||
| IOS_SIMULATOR_OS: "18.4" | ||
| TVOS_SIMULATOR_DEVICE: "Apple TV 4K (3rd generation)" | ||
| TVOS_SIMULATOR_OS: "18.4" | ||
|
|
||
| jobs: | ||
| CI: | ||
| runs-on: macos-latest | ||
|
|
||
| runs-on: macos-15 | ||
| # ℹ️ Available GitHub Actions Runner Images | ||
| # https://github.com/actions/runner-images | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - run: bundle install | ||
| - run: pod install --repo-update | ||
| - name: Setup CocoaPods | ||
| run: pod install --repo-update | ||
|
|
||
| - name: Set Xcode Version 14.2.0 (iOS 16.2) | ||
| run: sudo xcode-select -s /Applications/Xcode_14.2.0.app | ||
| - name: Set Xcode Version | ||
| run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app | ||
|
|
||
| - name: Build PinLayout-iOS | ||
| run: set -o pipefail && xcodebuild build -project PinLayout.xcodeproj -scheme PinLayout-iOS -sdk iphonesimulator16.2 -destination 'platform=iOS Simulator,name=iPhone SE (3rd generation),OS=16.2' | xcpretty | ||
| run: | | ||
| set -o pipefail && xcodebuild build \ | ||
| -project PinLayout.xcodeproj \ | ||
| -scheme PinLayout-iOS \ | ||
| -sdk iphonesimulator \ | ||
| -destination "platform=iOS Simulator,name=${{ env.IOS_SIMULATOR_DEVICE }},OS=${{ env.IOS_SIMULATOR_OS }}" \ | ||
| | xcpretty | ||
|
|
||
| - name: Build PinLayout-tvOS | ||
| run: set -o pipefail && xcodebuild build -project PinLayout.xcodeproj -scheme PinLayout-tvOS -sdk appletvsimulator16.1 -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=16.1' | xcpretty | ||
| run: | | ||
| set -o pipefail && xcodebuild build \ | ||
| -project PinLayout.xcodeproj \ | ||
| -scheme PinLayout-tvOS \ | ||
| -sdk appletvsimulator \ | ||
| -destination "platform=tvOS Simulator,name=${{ env.TVOS_SIMULATOR_DEVICE }},OS=${{ env.TVOS_SIMULATOR_OS }}" \ | ||
| | xcpretty | ||
|
|
||
| - name: Build PinLayout-macOS | ||
| run: set -o pipefail && xcodebuild build -project PinLayout.xcodeproj -scheme PinLayout-macOS -sdk macosx13.1 | xcpretty | ||
|
|
||
| - name: Build PinLayoutSample - iOS 16.2 | ||
| run: set -o pipefail && xcodebuild build -workspace PinLayout.xcworkspace -scheme PinLayoutSample -sdk iphonesimulator16.2 -destination 'platform=iOS Simulator,name=iPhone SE (3rd generation),OS=16.2' | xcpretty | ||
|
|
||
| - name: iOS unit tests | ||
| run: set -o pipefail && xcodebuild build test -workspace PinLayout.xcworkspace -scheme PinLayout-iOS -sdk iphonesimulator16.2 -destination 'platform=iOS Simulator,name=iPhone SE (3rd generation),OS=16.2' | xcpretty | ||
|
|
||
| # # - name: tvOS unit tests | ||
| # # run: set -o pipefail && xcodebuild build test -workspace PinLayout.xcworkspace -scheme PinLayout-tvOS -sdk appletvos16.1 -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=16.2' | xcpretty | ||
|
|
||
| # # - name: macOS unit tests | ||
| # # run: set -o pipefail && xcodebuild test -workspace PinLayout.xcworkspace -scheme PinLayout-macOS -sdk macosx12.1 -destination 'platform=macOS,name=Any Mac' | xcpretty | ||
|
|
||
| - name: Cocoapods - iOS Empty project | ||
| run: set -o pipefail && cd TestProjects/cocoapods/ios && arch -x86_64 pod install && xcodebuild build -workspace PinLayout-iOS.xcworkspace -scheme PinLayout-iOS -sdk iphonesimulator16.2 -destination 'platform=iOS Simulator,name=iPhone SE (3rd generation),OS=16.2' | xcpretty && cd ../../.. | ||
|
|
||
| # - name: Cocoapods - macOS Empty project | ||
| # run: set -o pipefail && cd TestProjects/cocoapods/macos && arch -x86_64 pod install && xcodebuild build -workspace PinLayout-macOS.xcworkspace -scheme PinLayout-macOS -sdk macosx12.1 | xcpretty && cd ../../.. | ||
|
|
||
| # - name: Cocoapods - tvOS Empty project | ||
| # run: set -o pipefail && cd TestProjects/cocoapods/tvos && arch -x86_64 pod install && xcodebuild build -workspace PinLayout-tvOS.xcworkspace -scheme PinLayout-tvOS -sdk appletvsimulator16.1 -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=16.1' | xcpretty && cd ../../.. | ||
|
|
||
| # - name: Carthage - iOS Empty project | ||
| # run: set -o pipefail && cd TestProjects/carthage/ios && rm Cartfile && echo "git \"file:///$BASEDIR\"" > Cartfile && carthage update --use-ssh --platform iOS --use-xcframeworks && xcodebuild build -project PinLayout-Carthage-iOS.xcodeproj -scheme PinLayout-Carthage-iOS -sdk iphonesimulator16.2 -destination 'platform=iOS Simulator,name=iPhone SE (3rd generation),OS=16.2' | xcpretty && rm Cartfile.resolved && cd ../../.. | ||
| run: | | ||
| set -o pipefail && xcodebuild build \ | ||
| -project PinLayout.xcodeproj \ | ||
| -scheme PinLayout-macOS \ | ||
| -sdk macosx \ | ||
| | xcpretty | ||
|
|
||
| - name: Build PinLayoutSample | ||
| run: | | ||
| set -o pipefail && xcodebuild build \ | ||
| -workspace PinLayout.xcworkspace \ | ||
| -scheme PinLayoutSample \ | ||
| -sdk iphonesimulator \ | ||
| -destination "platform=iOS Simulator,name=${{ env.IOS_SIMULATOR_DEVICE }},OS=${{ env.IOS_SIMULATOR_OS }}" \ | ||
| | xcpretty | ||
|
|
||
| - name: iOS Unit Tests | ||
| run: | | ||
| set -o pipefail && xcodebuild build test \ | ||
| -workspace PinLayout.xcworkspace \ | ||
| -scheme PinLayout-iOS \ | ||
| -sdk iphonesimulator \ | ||
| -destination "platform=iOS Simulator,name=${{ env.IOS_SIMULATOR_DEVICE }},OS=${{ env.IOS_SIMULATOR_OS }}" \ | ||
| | xcpretty | ||
|
|
||
| # - name: tvOS Unit Tests | ||
| # run: | | ||
| # set -o pipefail && xcodebuild build test \ | ||
| # -workspace PinLayout.xcworkspace \ | ||
| # -scheme PinLayout-tvOS \ | ||
| # -sdk appletvsimulator \ | ||
| # -destination "platform=tvOS Simulator,name=${{ env.TVOS_SIMULATOR_DEVICE }},OS=${{ env.TVOS_SIMULATOR_OS }}" \ | ||
| # | xcpretty | ||
|
|
||
| # - name: macOS Unit Tests | ||
| # run: | | ||
| # set -o pipefail && xcodebuild test \ | ||
| # -workspace PinLayout.xcworkspace \ | ||
| # -scheme PinLayout-macOS \ | ||
| # -sdk macosx \ | ||
| # -destination "platform=macOS,name=Any Mac" \ | ||
| # | xcpretty | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test compilation fails with the current project structure. For now, I have fixed the existing test code to make it work, but further improvements should be addressed in a separate PR. |
||
|
|
||
| - name: Test CocoaPods Integration | ||
| run: | | ||
| echo "Testing CocoaPods integration..." | ||
| cd TestProjects/cocoapods/ios | ||
| pod install | ||
| set -o pipefail && xcodebuild build \ | ||
| -workspace PinLayout-iOS.xcworkspace \ | ||
| -scheme PinLayout-iOS \ | ||
| -sdk iphonesimulator \ | ||
| -destination "platform=iOS Simulator,name=${{ env.IOS_SIMULATOR_DEVICE }},OS=${{ env.IOS_SIMULATOR_OS }}" \ | ||
| | xcpretty | ||
| cd ../../.. | ||
|
|
||
| # - name: Test CocoaPods macOS Integration | ||
| # run: | | ||
| # cd TestProjects/cocoapods/macos | ||
| # pod install | ||
| # set -o pipefail && xcodebuild build \ | ||
| # -workspace PinLayout-macOS.xcworkspace \ | ||
| # -scheme PinLayout-macOS \ | ||
| # -sdk macosx \ | ||
| # | xcpretty | ||
| # cd ../../.. | ||
|
|
||
| # - name: Test CocoaPods tvOS Integration | ||
| # run: | | ||
| # cd TestProjects/cocoapods/tvos | ||
| # pod install | ||
| # set -o pipefail && xcodebuild build \ | ||
| # -workspace PinLayout-tvOS.xcworkspace \ | ||
| # -scheme PinLayout-tvOS \ | ||
| # -sdk appletvsimulator \ | ||
| # -destination "platform=tvOS Simulator,name=${{ env.TVOS_SIMULATOR_DEVICE }},OS=${{ env.TVOS_SIMULATOR_OS }}" \ | ||
| # | xcpretty | ||
| # cd ../../.. | ||
|
|
||
| # - name: Test Carthage Integration | ||
| # run: | | ||
| # cd TestProjects/carthage/ios | ||
| # rm Cartfile | ||
| # echo "git \"file:///$GITHUB_WORKSPACE\"" > Cartfile | ||
| # carthage update --use-ssh --platform iOS --use-xcframeworks | ||
| # set -o pipefail && xcodebuild build \ | ||
| # -project PinLayout-Carthage-iOS.xcodeproj \ | ||
| # -scheme PinLayout-Carthage-iOS \ | ||
| # -sdk iphonesimulator \ | ||
| # -destination "platform=iOS Simulator,name=${{ env.IOS_SIMULATOR_DEVICE }},OS=${{ env.IOS_SIMULATOR_OS }}" \ | ||
| # | xcpretty | ||
| # rm Cartfile.resolved | ||
| # cd ../../.. | ||
|
|
||
| - name: Swift Package Manager - iOS Empty project | ||
| run: set -o pipefail && cd TestProjects/swift-package-manager/ios && rm -rf .build && xcodebuild build -project PinLayout-SPM-iOS.xcodeproj -scheme PinLayout-SPM-iOS -sdk iphonesimulator16.2 -destination 'platform=iOS Simulator,name=iPhone SE (3rd generation),OS=16.2' | xcpretty && cd ../../.. | ||
|
|
||
| - name: Set XCode Version 13.4.1 (iOS 15.5) | ||
| run: sudo xcode-select -s /Applications/Xcode_13.4.1.app | ||
| - name: Build PinLayoutSample - iOS 15.5 | ||
| run: set -o pipefail && xcodebuild clean build -workspace PinLayout.xcworkspace -scheme PinLayoutSample -sdk iphonesimulator15.5 -destination 'platform=iOS Simulator,name=iPhone 8,OS=15.5' | xcpretty | ||
|
|
||
| - name: Pod lib lint | ||
| run: set -o pipefail && bundle exec pod lib lint --allow-warnings | ||
| run: | | ||
| cd TestProjects/swift-package-manager/ios | ||
| rm -rf .build | ||
| set -o pipefail && xcodebuild build \ | ||
| -project PinLayout-SPM-iOS.xcodeproj \ | ||
| -scheme PinLayout-SPM-iOS \ | ||
| -sdk iphonesimulator \ | ||
| -destination "platform=iOS Simulator,name=${{ env.IOS_SIMULATOR_DEVICE }},OS=${{ env.IOS_SIMULATOR_OS }}" \ | ||
| | xcpretty | ||
| cd ../../.. | ||
|
|
||
| - name: Pod Lib Lint | ||
| run: set -o pipefail && pod lib lint --allow-warnings | ||
|
|
||
| - name: Codecov | ||
| run: bash <(curl -s https://codecov.io/bash) -D /tmp/PinLayout | ||
|
|
||
| - run: echo "🍏 This job's status is ${{ job.status }}." | ||
| - name: Job Status | ||
| run: echo "🍏 This job's status is ${{ job.status }}." | ||
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the CI Xcode version to 16.4.