Bump actions/cache from 3 to 4 (#85) #80
This file contains 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: CI | |
on: | |
push: | |
branches: | |
- main | |
- master | |
- develop | |
- release | |
- hotfix/* | |
pull_request: | |
branches-ignore: | |
- demo | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: CocoaPods Cache | |
uses: actions/cache@v4 | |
with: | |
path: "Pods" | |
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pods- | |
- name: Setup Project | |
run: | | |
pod --version | |
isNeedsPodInstall=false | |
diff "Podfile.lock" "Pods/Manifest.lock" >/dev/null || { | |
isNeedsPodInstall=true | |
} | |
if $isNeedsPodInstall; then | |
pod install || { | |
echo "pod install fails, try update repo" | |
pod install --repo-update | |
} | |
else | |
echo "Podfile unchanged, skip pod install." | |
fi | |
- name: Build maccatalyst target | |
run: | | |
set -o pipefail | |
xcodebuild -workspace "App.xcworkspace" -scheme "App" -destination 'platform=macOS,arch=x86_64' | xcpretty | |
- name: Build iOS target | |
run: | | |
set -o pipefail | |
xcodebuild -workspace "App.xcworkspace" -scheme "App" -destination 'platform=iOS Simulator,name=iPhone 14' | xcpretty |