diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a073837f..062522a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,14 @@ concurrency: jobs: library: + strategy: + matrix: + platform: + - iOS Simulator,name=iPhone 14 Pro + - macOS + - macOS,variant=Mac Catalyst + - tvOS Simulator,name=Apple TV + - watchOS Simulator,name=Apple Watch Series 8 (41mm) runs-on: macos-13 name: Test Library steps: @@ -22,9 +30,13 @@ jobs: - name: Select Xcode 14.3 run: sudo xcode-select -s /Applications/Xcode_14.3.app - name: Run tests - run: make test-library + run: env PLATFORM="${{ matrix.platform }}" make test-library example: + strategy: + matrix: + platform: + - iOS Simulator,name=iPhone 14 Pro runs-on: macos-13 name: Build Example steps: @@ -34,4 +46,4 @@ jobs: - name: Copy Secrets file run: cp Examples/Examples/_Secrets.swift Examples/Examples/Secrets.swift - name: Build example - run: make build-example + run: env PLATFORM="${{ matrix.platform }}" make build-example diff --git a/Makefile b/Makefile index f11b2e01..2e8b86ee 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,17 @@ -PLATFORM_IOS = iOS Simulator,name=iPhone 15 Pro -PLATFORM_MACOS = macOS -PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst -PLATFORM_TVOS = tvOS Simulator,name=Apple TV -PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 9 (41mm) +PLATFORM ?= iOS Simulator,name=iPhone 15 Pro test-library: - for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_WATCHOS)"; do \ - xcodebuild test \ - -workspace supabase-swift.xcworkspace \ - -scheme Supabase-Package \ - -destination platform="$$platform" || exit 1; \ - done; + xcodebuild test \ + -workspace supabase-swift.xcworkspace \ + -scheme Supabase-Package \ + -destination platform="$(PLATFORM)" || exit 1; build-example: for example in "Examples" "ProductSample"; do \ xcodebuild build \ -workspace supabase-swift.xcworkspace \ -scheme "$$example" \ - -destination platform="$(PLATFORM_IOS)" || exit 1; \ + -destination platform="$(PLATFORM)" || exit 1; \ done; format: