ci: SQDSDKS-7487 - Add GitHub Actions to Apple Media SDK #14
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: iOS SDK Build and Lint | |
| on: [pull_request] | |
| jobs: | |
| pod-lint: | |
| runs-on: macOS-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.4.app | |
| - name: Update xcodeproj gem | |
| run: sudo gem install xcodeproj | |
| - name: Prevent social URL warnings if twitter is unreachable | |
| run: find . -path '*.podspec' -exec perl -pi -e 's/.+\.social_media_url.+//' {} \; | |
| - name: Lint with CocoaPods | |
| run: pod lib lint | |
| - name: Undo twitter change to podspec | |
| run: git checkout *.podspec | |
| carthage-build: | |
| runs-on: macOS-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.4.app | |
| - name: Read Carthage Version | |
| run: | | |
| CURRENT_CARTHAGE_VERSION=$(carthage version) | |
| echo "CURRENT_CARTHAGE_VERSION=$CURRENT_CARTHAGE_VERSION" >> $GITHUB_ENV | |
| - name: Read Xcode Version | |
| run: | | |
| CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3) | |
| echo "CURRENT_XCODE_VERSION=$CURRENT_XCODE_VERSION" >> $GITHUB_ENV | |
| - name: Boot iPhone 16 Simulator (iOS 18.5) | |
| run: | | |
| RUNTIME_ID=$( | |
| xcrun simctl list runtimes \ | |
| | awk -F '[()]' '/iOS 18\.5/ {print $2; exit}' | |
| ) | |
| UDID=$( | |
| xcrun simctl list devices "$RUNTIME_ID" --json \ | |
| | jq -r '.devices[][] | select(.name=="iPhone 16") | .udid' | |
| ) | |
| xcrun simctl boot "$UDID" || true | |
| echo "SIMULATOR_UDID=$UDID" >> $GITHUB_ENV | |
| echo "Booted simulator $UDID on $RUNTIME_ID" | |
| - name: Build with Carthage | |
| run: ./Scripts/carthage.sh build --no-skip-current || true | |
| - name: Carthage archive | |
| run: carthage archive mParticle_Apple_Media_SDK | |
| - name: Verify carthage products | |
| run: ls 2>&1 | grep .framework.zip | |
| run-analyzer: | |
| runs-on: macOS-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.4.app | |
| - name: Run static analyzer | |
| run: | | |
| bash -c '! (set -o pipefail && xcodebuild -project "mParticle-Apple-Media-SDK.xcodeproj" -scheme "mParticle-Apple-Media-SDK" -sdk iphonesimulator -configuration Debug -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" clean analyze | grep -v "warning: The iOS Simulator deployment target" | grep -B3 "warning")' |