Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: make unit tests run in parallel #205

Merged
merged 12 commits into from
Aug 17, 2024
64 changes: 40 additions & 24 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
jobs:
test:
runs-on: macos-13
strategy:
matrix:
platform: [iOS, macOS, tvOS, watchOS]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -22,32 +26,44 @@ jobs:
- name: List Project Configuration
run: |
xcodebuild -list
- name: iOS Tests
- name: ${{ matrix.platform }} Tests
run: |
xcodebuild test \
-scheme Amplitude-Swift-Package \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 15'
- name: macOS Tests
run: |
xcodebuild test \
-scheme Amplitude-Swift-Package \
-sdk macosx \
-destination 'platform=macosx'
- name: tvOS Tests
run: |
xcodebuild \
-scheme Amplitude-Swift-Package \
-sdk appletvsimulator \
-destination 'platform=tvOS Simulator,name=Apple TV' \
test
- name: watchOS Tests
case "${{ matrix.platform }}" in
iOS)
xcodebuild test \
-scheme Amplitude-Swift-Package \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 15'
PouriaAmini marked this conversation as resolved.
Show resolved Hide resolved
;;
macOS)
xcodebuild test \
-scheme Amplitude-Swift-Package \
-sdk macosx \
-destination 'platform=macosx'
;;
tvOS)
xcodebuild \
-scheme Amplitude-Swift-Package \
-sdk appletvsimulator \
-destination 'platform=tvOS Simulator,name=Apple TV' \
test
;;
watchOS)
xcodebuild \
-scheme Amplitude-Swift-Package \
-sdk watchsimulator \
-destination 'platform=watchOS Simulator,name=Apple Watch Series 8 (41mm)' \
test
;;
esac
objc-example-test:
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Xcode 15
run: |
xcodebuild \
-scheme Amplitude-Swift-Package \
-sdk watchsimulator \
-destination 'platform=watchOS Simulator,name=Apple Watch Series 8 (41mm)' \
test
sudo xcode-select -switch /Applications/Xcode_15.2.app
- name: Objective-C Example Tests (iOS)
working-directory: Examples/AmplitudeObjCExample
run: |
Expand Down
Loading