Skip to content

Fix CI and re-enable platform builds #140

Fix CI and re-enable platform builds

Fix CI and re-enable platform builds #140

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-15
# ℹ️ Available GitHub Actions Runner Images
# https://github.com/actions/runner-images
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup CocoaPods
run: pod install --repo-update
- 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 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 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 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 \
-workspace PinLayout.xcworkspace \
-scheme Pods-PinLayoutTests-tvOS \
-sdk appletvsimulator \
-destination "platform=tvOS Simulator,name=${{ env.TVOS_SIMULATOR_DEVICE }},OS=${{ env.TVOS_SIMULATOR_OS }}" \
-derivedDataPath /tmp/PinLayout-tvOS \
| xcpretty
xcodebuild build \
-workspace PinLayout.xcworkspace \
-scheme PinLayout-tvOS \
-sdk appletvsimulator \
-destination "platform=tvOS Simulator,name=${{ env.TVOS_SIMULATOR_DEVICE }},OS=${{ env.TVOS_SIMULATOR_OS }}" \
-derivedDataPath /tmp/PinLayout-tvOS \
| xcpretty
xcodebuild test \
-workspace PinLayout.xcworkspace \
-scheme PinLayout-tvOS \
-sdk appletvsimulator \
-destination "platform=tvOS Simulator,name=${{ env.TVOS_SIMULATOR_DEVICE }},OS=${{ env.TVOS_SIMULATOR_OS }}" \
-derivedDataPath /tmp/PinLayout-tvOS \
| xcpretty
- name: macOS Unit Tests
run: |
set -o pipefail
xcodebuild build \
-workspace PinLayout.xcworkspace \
-scheme Pods-PinLayoutTests-macOS \
-sdk macosx \
-destination "platform=macOS,arch=$(uname -m)" \
-derivedDataPath /tmp/PinLayout-macOS \
| xcpretty
xcodebuild build \
-workspace PinLayout.xcworkspace \
-scheme PinLayout-macOS \
-sdk macosx \
-destination "platform=macOS,arch=$(uname -m)" \
-derivedDataPath /tmp/PinLayout-macOS \
| xcpretty
xcodebuild test \
-workspace PinLayout.xcworkspace \
-scheme PinLayout-macOS \
-sdk macosx \
-destination "platform=macOS,arch=$(uname -m)" \
-derivedDataPath /tmp/PinLayout-macOS \
| xcpretty
- 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\" \"$GITHUB_SHA\"" > 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: |
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
- name: Job Status
run: echo "🍏 This job's status is ${{ job.status }}."