Skip to content

Commit 9f15d2d

Browse files
authored
chore: refactor ci (#474)
1 parent 4a2093d commit 9f15d2d

24 files changed

+169
-171
lines changed

.github/workflows/auth.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,18 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
platform:
28-
- macOS
29-
- macOS,variant=Mac Catalyst
30-
- iOS Simulator,name=iPhone 15 Pro
31-
- tvOS Simulator,name=Apple TV
32-
- watchOS Simulator,name=Apple Watch Series 9 (41mm)
33-
- visionOS Simulator,name=Any visionOS Simulator Device
27+
config:
28+
- debug
29+
- release
3430
runs-on: macos-14
3531
steps:
3632
- uses: actions/checkout@v3
3733
with:
3834
fetch-depth: 0
39-
- name: Select Xcode 15.3
40-
run: sudo xcode-select -s /Applications/Xcode_15.3.app
35+
- name: Select Xcode 15.4
36+
run: sudo xcode-select -s /Applications/Xcode_15.4.app
4137
- name: Run tests
42-
run: PLATFORM="${{ matrix.platform }}" SCHEME=Auth make test-library
38+
run: CONFIG="${{ matrix.config }}" make test-auth
4339

4440
test-linux:
4541
name: Test Auth (Linux)

.github/workflows/functions.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,18 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
platform:
28-
- macOS
29-
- macOS,variant=Mac Catalyst
30-
- iOS Simulator,name=iPhone 15 Pro
31-
- tvOS Simulator,name=Apple TV
32-
- watchOS Simulator,name=Apple Watch Series 9 (41mm)
33-
- visionOS Simulator,name=Any visionOS Simulator Device
27+
config:
28+
- debug
29+
- release
3430
runs-on: macos-14
3531
steps:
3632
- uses: actions/checkout@v3
3733
with:
3834
fetch-depth: 0
39-
- name: Select Xcode 15.3
40-
run: sudo xcode-select -s /Applications/Xcode_15.3.app
35+
- name: Select Xcode 15.4
36+
run: sudo xcode-select -s /Applications/Xcode_15.4.app
4137
- name: Run tests
42-
run: PLATFORM="${{ matrix.platform }}" SCHEME=Functions make test-library
38+
run: CONFIG="${{ matrix.config }}" make test-functions
4339
test-linux:
4440
name: Test Functions (Linux)
4541
strategy:

.github/workflows/integration-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
- uses: actions/checkout@v3
2020
with:
2121
fetch-depth: 0
22-
- name: Select Xcode 15.3
23-
run: sudo xcode-select -s /Applications/Xcode_15.3.app
22+
- name: Select Xcode 15.4
23+
run: sudo xcode-select -s /Applications/Xcode_15.4.app
2424
- name: Run tests
2525
run: make test-integration
2626
env:

.github/workflows/postgrest.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,18 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
platform:
28-
- macOS
29-
- macOS,variant=Mac Catalyst
30-
- iOS Simulator,name=iPhone 15 Pro
31-
- tvOS Simulator,name=Apple TV
32-
- watchOS Simulator,name=Apple Watch Series 9 (41mm)
33-
- visionOS Simulator,name=Any visionOS Simulator Device
27+
config:
28+
- debug
29+
- release
3430
runs-on: macos-14
3531
steps:
3632
- uses: actions/checkout@v3
3733
with:
3834
fetch-depth: 0
39-
- name: Select Xcode 15.3
40-
run: sudo xcode-select -s /Applications/Xcode_15.3.app
35+
- name: Select Xcode 15.4
36+
run: sudo xcode-select -s /Applications/Xcode_15.4.app
4137
- name: Run tests
42-
run: PLATFORM="${{ matrix.platform }}" SCHEME=PostgREST make test-library
38+
run: CONFIG="${{ matrix.config }}" make test-postgrest
4339
test-linux:
4440
name: Test Postgrest (Linux)
4541
strategy:

.github/workflows/realtime.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,18 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
platform:
28-
- macOS
29-
- macOS,variant=Mac Catalyst
30-
- iOS Simulator,name=iPhone 15 Pro
31-
- tvOS Simulator,name=Apple TV
32-
- watchOS Simulator,name=Apple Watch Series 9 (41mm)
33-
- visionOS Simulator,name=Any visionOS Simulator Device
27+
config:
28+
- debug
29+
- release
3430
runs-on: macos-14
3531
steps:
3632
- uses: actions/checkout@v3
3733
with:
3834
fetch-depth: 0
39-
- name: Select Xcode 15.3
40-
run: sudo xcode-select -s /Applications/Xcode_15.3.app
35+
- name: Select Xcode 15.4
36+
run: sudo xcode-select -s /Applications/Xcode_15.4.app
4137
- name: Run tests
42-
run: PLATFORM="${{ matrix.platform }}" SCHEME=Realtime make test-library
38+
run: CONFIG="${{ matrix.config }}" make test-realtime
4339
test-linux:
4440
name: Test Realtime (Linux)
4541
strategy:

.github/workflows/storage.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,18 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
platform:
28-
- macOS
29-
- macOS,variant=Mac Catalyst
30-
- iOS Simulator,name=iPhone 15 Pro
31-
- tvOS Simulator,name=Apple TV
32-
- watchOS Simulator,name=Apple Watch Series 9 (41mm)
33-
- visionOS Simulator,name=Any visionOS Simulator Device
27+
config:
28+
- debug
29+
- release
3430
runs-on: macos-14
3531
steps:
3632
- uses: actions/checkout@v3
3733
with:
3834
fetch-depth: 0
39-
- name: Select Xcode 15.3
40-
run: sudo xcode-select -s /Applications/Xcode_15.3.app
35+
- name: Select Xcode 15.4
36+
run: sudo xcode-select -s /Applications/Xcode_15.4.app
4137
- name: Run tests
42-
run: PLATFORM="${{ matrix.platform }}" SCHEME=Storage make test-library
38+
run: CONFIG="${{ matrix.config }}" make test-storage
4339
test-linux:
4440
name: Test Storage (Linux)
4541
strategy:

.github/workflows/supabase.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,18 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
platform:
28-
- macOS
29-
- macOS,variant=Mac Catalyst
30-
- iOS Simulator,name=iPhone 15 Pro
31-
- tvOS Simulator,name=Apple TV
32-
- watchOS Simulator,name=Apple Watch Series 9 (41mm)
33-
- visionOS Simulator,name=Any visionOS Simulator Device
27+
config:
28+
- debug
29+
- release
3430
runs-on: macos-14
3531
steps:
3632
- uses: actions/checkout@v3
3733
with:
3834
fetch-depth: 0
39-
- name: Select Xcode 15.3
40-
run: sudo xcode-select -s /Applications/Xcode_15.3.app
35+
- name: Select Xcode 15.4
36+
run: sudo xcode-select -s /Applications/Xcode_15.4.app
4137
- name: Run tests
42-
run: PLATFORM="${{ matrix.platform }}" SCHEME=Supabase make test-library
38+
run: CONFIG="${{ matrix.config }}" make test-library
4339
test-linux:
4440
name: Test Supabase (Linux)
4541
strategy:

.swiftpm/xcode/xcshareddata/xcschemes/Supabase.xcscheme

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,11 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<TestPlans>
3131
<TestPlanReference
32-
reference = "container:TestPlans/AllTests.xctestplan"
32+
reference = "container:TestPlans/Supabase.xctestplan"
3333
default = "YES">
3434
</TestPlanReference>
3535
<TestPlanReference
36-
reference = "container:TestPlans/IntegrationTests.xctestplan">
37-
</TestPlanReference>
38-
<TestPlanReference
39-
reference = "container:TestPlans/Supabase.xctestplan">
36+
reference = "container:TestPlans/Integration.xctestplan">
4037
</TestPlanReference>
4138
</TestPlans>
4239
</TestAction>

Makefile

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
PLATFORM_IOS = iOS Simulator,name=iPhone 15 Pro
1+
CONFIG = debug
2+
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS 17.5,iPhone \d\+ Pro [^M])
23
PLATFORM_MACOS = macOS
34
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
4-
PLATFORM_TVOS = tvOS Simulator,name=Apple TV
5-
PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 9 (41mm)
5+
PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,tvOS 17.5,TV)
6+
PLATFORM_VISIONOS = visionOS Simulator,id=$(call udid_for,visionOS 1.2,Vision)
7+
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,watchOS 10.5,Watch)
68

79
SCHEME ?= Supabase
8-
PLATFORM ?= iOS Simulator,name=iPhone 15 Pro
10+
PLATFORM ?= $(PLATFORM_IOS)
911

1012
export SECRETS
1113
define SECRETS
@@ -22,31 +24,50 @@ load-env:
2224
dot-env:
2325
@echo "$$SECRETS" > Tests/IntegrationTests/DotEnv.swift
2426

25-
test-all: dot-env
26-
set -o pipefail && \
27-
xcodebuild test \
28-
-skipMacroValidation \
29-
-workspace supabase-swift.xcworkspace \
30-
-scheme "$(SCHEME)" \
31-
-testPlan AllTests \
32-
-destination platform="$(PLATFORM)" | xcpretty
27+
28+
build-all-platforms:
29+
for platform in "iOS" "macOS" "macOS,variant=Mac Catalyst" "tvOS" "visionOS" "watchOS"; do \
30+
xcodebuild \
31+
-skipMacroValidation \
32+
-configuration "$(CONFIG)" \
33+
-workspace Supabase.xcworkspace \
34+
-scheme "$(SCHEME)" \
35+
-testPlan AllTests \
36+
-destination platform="$$platform" | xcpretty || exit 1; \
37+
done
3338

3439
test-library: dot-env
35-
set -o pipefail && \
36-
xcodebuild test \
37-
-skipMacroValidation \
38-
-workspace supabase-swift.xcworkspace \
39-
-scheme "$(SCHEME)" \
40-
-derivedDataPath /tmp/derived-data \
41-
-destination platform="$(PLATFORM)" | xcpretty
40+
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_VISIONOS)" "$(PLATFORM_WATCHOS)"; do \
41+
xcodebuild test \
42+
-skipMacroValidation \
43+
-configuration "$(CONFIG)" \
44+
-workspace Supabase.xcworkspace \
45+
-scheme "$(SCHEME)" \
46+
-destination platform="$$platform" | xcpretty || exit 1; \
47+
done
48+
49+
test-auth:
50+
$(MAKE) SCHEME=Auth test-library
51+
52+
test-functions:
53+
$(MAKE) SCHEME=Functions test-library
54+
55+
test-postgrest:
56+
$(MAKE) SCHEME=PostgREST test-library
57+
58+
test-realtime:
59+
$(MAKE) SCHEME=Realtime test-library
60+
61+
test-storage:
62+
$(MAKE) SCHEME=Storage test-library
4263

4364
test-integration: dot-env
4465
set -o pipefail && \
4566
xcodebuild test \
4667
-skipMacroValidation \
47-
-workspace supabase-swift.xcworkspace \
68+
-workspace Supabase.xcworkspace \
4869
-scheme Supabase \
49-
-testPlan IntegrationTests \
70+
-testPlan Integration \
5071
-destination platform="$(PLATFORM_IOS)" | xcpretty
5172

5273

@@ -80,7 +101,7 @@ build-examples:
80101
set -o pipefail && \
81102
xcodebuild build \
82103
-skipMacroValidation \
83-
-workspace supabase-swift.xcworkspace \
104+
-workspace Supabase.xcworkspace \
84105
-scheme "$$scheme" \
85106
-destination platform="$(PLATFORM_IOS)" | xcpretty; \
86107
done
@@ -89,3 +110,7 @@ format:
89110
@swiftformat .
90111

91112
.PHONY: test-library test-linux build-example format
113+
114+
define udid_for
115+
$(shell xcrun simctl list devices available '$(1)' | grep '$(2)' | sort -r | head -1 | awk -F '[()]' '{ print $$(NF-3) }')
116+
endef

Package.resolved

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)