Skip to content

Commit

Permalink
๐Ÿ‘ท Test destination ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
SwiftyJunnos committed Nov 25, 2023
1 parent 697d6ac commit aada654
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/Xcode_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Xcode
if: ${{ !env.ACT }}
Expand Down Expand Up @@ -46,8 +46,23 @@ jobs:
done
cd ..
done
# cd Features
# for package in JourneyList SaveJourney; 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 "{matrix}=$matrix" >> $GITHUB_OUTPUT
echo "matrix=$matrix" >> $GITHUB_OUTPUT
build-and-test:
needs: prepare-matrix
Expand All @@ -57,7 +72,7 @@ jobs:
matrix: ${{fromJson(needs.prepare-matrix.outputs.matrix)}}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Xcode
if: ${{ !env.ACT }}
Expand All @@ -72,14 +87,18 @@ jobs:
cd iOS/${{ matrix.package }}
xcodebuild \
-scheme ${{ matrix.scheme }} \
-destination 'platform=iOS Simulator,name=iPhone 15 Pro' \
-sdk 'iphonesimulator' \
-destination 'platform=iOS Simulator,OS=17.0.1,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 \
xcodebuild \
-scheme ${{ matrix.scheme }} \
-destination 'platform=iOS Simulator,name=iPhone 15 Pro'
-sdk 'iphonesimulator' \
-destination 'platform=iOS Simulator,OS=17.0.1,name=iPhone 15 Pro' \
-only-testing:${{ matrix.scheme }} \
clean test
8 changes: 4 additions & 4 deletions iOS/MSCoreKit/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ let package = Package(

// Tests
.testTarget(name: .persistentStorage.testTarget,
dependencies: [.target(name: .persistentStorage)]),
dependencies: ["MSPersistentStorage"]),
.testTarget(name: .networking.testTarget,
dependencies: [.target(name: .networking)]),
dependencies: ["MSNetworking"]),
.testTarget(name: .fetcher.testTarget,
dependencies: [.target(name: .fetcher)]),
dependencies: ["MSFetcher"]),
.testTarget(name: .cache.testTarget,
dependencies: [.target(name: .cache)])
dependencies: ["MSCacheStorage"])
],
swiftLanguageVersions: [.v5]
)

0 comments on commit aada654

Please sign in to comment.