Created
June 30, 2020 14:14
-
-
Save ricardopereira/10198e68f27c14601d77ebc7a8352da1 to your computer and use it in GitHub Desktop.
GitHub Action example running Xcode tests and caches dependencies
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
on: | |
push: | |
branches: | |
- develop | |
name: Build | |
jobs: | |
iOS: | |
name: Unit Tests | |
runs-on: macOS-latest | |
strategy: | |
matrix: | |
destination: ['platform=iOS Simulator,OS=13.5,name=iPhone 11'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- uses: actions/cache@v2 | |
id: carthage-cache | |
with: | |
path: Carthage | |
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-carthage- | |
- uses: actions/cache@v2 | |
id: cocoapods-cache | |
with: | |
path: Pods | |
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pods- | |
- name: Carthage | |
if: steps.carthage-cache.outputs.cache-hit != 'true' | |
run: | | |
carthage bootstrap --no-use-binaries --platform iOS --cache-builds | |
rm -rf ./Carthage/Build/iOS/*.dSYM | |
- name: CocoaPods | |
if: steps.cocoapods-cache.outputs.cache-hit != 'true' | |
run: | | |
pod install | |
- name: Build | |
run: | | |
mv Optimize/Secrets.swift.example Optimize/Secrets.swift | |
xcodebuild build test -workspace ./Optimize.xcworkspace -scheme Optimize -destination "${destination}" | |
env: | |
destination: ${{ matrix.destination }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment