👷 iOS 경로 수정 #4
Workflow file for this run
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: Xcode_build_test | |
on: | |
push: | |
branches: ['iOS/epic/xcode-ci'] | |
pull_request: | |
branches: | |
- 'iOS/release' | |
- 'iOS/epic/**' | |
types: [assigned, labeled, opened, synchronize, reopened] | |
jobs: | |
prepare-matrix: | |
runs-on: macos-13 | |
env: | |
working-directory: ./iOS | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Xcode | |
if: ${{ !env.ACT }} | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest | |
- name: Generate matrix | |
id: set-matrix | |
run: | | |
cd iOS | |
matrix="{\"include\":[" | |
first_entry=true | |
for package in MSCoreKit MSFoundation MSUIKit; do | |
cd $package | |
for scheme in $(xcodebuild -list | grep -E '^[[:space:]]*Schemes:' -A 10 | tail -n +2 | grep -v '^$'); do | |
if [[ $scheme != *"-Package" ]]; then | |
if [ "$first_entry" = true ]; then | |
first_entry=false | |
else | |
matrix+="," | |
fi | |
matrix+="{\"package\":\"$package\", \"scheme\":\"$scheme\"}" | |
fi | |
done | |
cd .. | |
done | |
matrix+="]}" | |
echo "::set-output name=matrix:: $matrix" | |
build-and-test: | |
needs: prepare-matrix | |
runs-on: macos-13 | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.prepare-matrix.outputs.matrix)}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Xcode | |
if: ${{ !env.ACT }} | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest | |
- name: 🛠️ Build ${{ matrix.scheme }} | |
if: ${{ !contains(matrix.scheme, 'Tests') }} | |
run: | | |
echo "🛠️ Building ${{ matrix.package }} - Scheme: ${{ matrix.scheme }}" | |
cd iOS/${{ matrix.package }} | |
xcodebuild \ | |
-scheme ${{ matrix.scheme }} \ | |
-destination 'platform=iOS Simulator,name=iPhone 15 Pro' \ | |
clean build | |
- name: 🧪 Test ${{ matrix.scheme }} | |
if: ${{ contains(matrix.scheme, 'Tests') }} | |
run: | | |
echo "🧪 Testing ${{ matrix.package }} - Scheme: ${{ matrix.scheme }}" | |
cd iOS/${{ matrix.package }} | |
xcodebuild clean test \ | |
-scheme ${{ matrix.scheme }} \ | |
-destination 'platform=iOS Simulator,name=iPhone 14 Pro' |