Skip to content

Commit 37dab1e

Browse files
committed
CI
1 parent 1c633de commit 37dab1e

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
- main
77
pull_request:
88
branches:
9-
- "*"
9+
- '*'
10+
workflow_dispatch:
1011

1112
concurrency:
1213
group: ci-${{ github.ref }}
@@ -15,32 +16,22 @@ concurrency:
1516
jobs:
1617
library:
1718
runs-on: macos-13
18-
strategy:
19-
matrix:
20-
platform:
21-
- iOS Simulator,name=iPhone 14 Pro Max
22-
- macOS
23-
- tvOS Simulator,name=Apple TV
24-
- watchOS Simulator,name=Apple Watch Series 7 (45mm)
25-
19+
name: Test Library
2620
steps:
2721
- uses: actions/checkout@v3
2822
- name: Select Xcode 14.3
2923
run: sudo xcode-select -s /Applications/Xcode_14.3.app
3024
- name: Run tests
31-
run: PLATFORM="${{ matrix.platform }}" make test-library
25+
run: make test-library
3226

3327
example:
3428
runs-on: macos-13
35-
strategy:
36-
matrix:
37-
platform:
38-
- iOS Simulator,name=iPhone 14 Pro Max
29+
name: Build Example
3930
steps:
4031
- uses: actions/checkout@v3
4132
- name: Select Xcode 14.3
4233
run: sudo xcode-select -s /Applications/Xcode_14.3.app
4334
- name: Copy Secrets file
4435
run: cp Examples/Examples/_Secrets.swift Examples/Examples/Secrets.swift
4536
- name: Build example
46-
run: PLATFORM="${{ matrix.platform }}" make build-example
37+
run: make build-example

Makefile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
PLATFORM = iOS Simulator,name=iPhone 15 Pro Max
1+
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iPhone,iOS-16)
2+
PLATFORM_MACOS = macOS
3+
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
4+
PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,TV,tvOS-16)
5+
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,Watch,watchOS-9)
26

37
test-library:
4-
xcodebuild test \
5-
-workspace supabase-swift.xcworkspace \
6-
-scheme Supabase-Package \
7-
-destination platform="$(PLATFORM)" || exit 1;
8+
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_WATCHOS)"; do \
9+
xcodebuild test \
10+
-workspace supabase-swift.xcworkspace \
11+
-scheme Supabase-Package \
12+
-destination platform="$$platform" || exit 1; \
13+
done;
814

915
build-example:
1016
xcodebuild build \
1117
-workspace supabase-swift.xcworkspace \
1218
-scheme Examples \
13-
-destination platform="$(PLATFORM)" || exit 1;
19+
-destination platform="$(PLATFORM_IOS)" || exit 1;
1420

1521
format:
1622
@swift format -i -r .
23+
24+
.PHONY: test-library build-example format
25+
26+
define udid_for
27+
$(shell xcrun simctl list --json devices available $(1) | jq -r '.devices | to_entries | map(select(.value | add)) | sort_by(.key) | .[] | select(.key | contains("$(2)")) | .value | last.udid')
28+
endef

0 commit comments

Comments
 (0)