Skip to content

Replace UIScreen.main to get display scale on iOS 13.0 and later #110

Replace UIScreen.main to get display scale on iOS 13.0 and later

Replace UIScreen.main to get display scale on iOS 13.0 and later #110

name: Run CI
on: [push, pull_request]
jobs:
CI:
runs-on: macos-latest
# ℹ️ Available GitHub Actions Runner Images
# https://github.com/actions/runner-images
steps:
- name: Checkout
uses: actions/checkout@v2
- run: bundle install
- 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: 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
- 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
- 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 ../../..
- 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
- name: Codecov
run: bash <(curl -s https://codecov.io/bash) -D /tmp/PinLayout
- run: echo "🍏 This job's status is ${{ job.status }}."