File tree Expand file tree Collapse file tree 2 files changed +24
-21
lines changed Expand file tree Collapse file tree 2 files changed +24
-21
lines changed Original file line number Diff line number Diff line change 6
6
- main
7
7
pull_request :
8
8
branches :
9
- - " *"
9
+ - ' *'
10
+ workflow_dispatch :
10
11
11
12
concurrency :
12
13
group : ci-${{ github.ref }}
@@ -15,32 +16,22 @@ concurrency:
15
16
jobs :
16
17
library :
17
18
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
26
20
steps :
27
21
- uses : actions/checkout@v3
28
22
- name : Select Xcode 14.3
29
23
run : sudo xcode-select -s /Applications/Xcode_14.3.app
30
24
- name : Run tests
31
- run : PLATFORM="${{ matrix.platform }}" make test-library
25
+ run : make test-library
32
26
33
27
example :
34
28
runs-on : macos-13
35
- strategy :
36
- matrix :
37
- platform :
38
- - iOS Simulator,name=iPhone 14 Pro Max
29
+ name : Build Example
39
30
steps :
40
31
- uses : actions/checkout@v3
41
32
- name : Select Xcode 14.3
42
33
run : sudo xcode-select -s /Applications/Xcode_14.3.app
43
34
- name : Copy Secrets file
44
35
run : cp Examples/Examples/_Secrets.swift Examples/Examples/Secrets.swift
45
36
- name : Build example
46
- run : PLATFORM="${{ matrix.platform }}" make build-example
37
+ run : make build-example
Original file line number Diff line number Diff line change 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)
2
6
3
7
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 ;
8
14
9
15
build-example :
10
16
xcodebuild build \
11
17
-workspace supabase-swift.xcworkspace \
12
18
-scheme Examples \
13
- -destination platform=" $( PLATFORM ) " || exit 1;
19
+ -destination platform=" $( PLATFORM_IOS ) " || exit 1;
14
20
15
21
format :
16
22
@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
You can’t perform that action at this time.
0 commit comments