Skip to content

Commit 7ef5223

Browse files
authored
ci: cache builds for improve build times (#286)
* ci: cache builds for improve build times * fix cache path * chore: use xcpretty * chore: use xcpretty on build-examples make target
1 parent 576693e commit 7ef5223

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@ jobs:
1919
name: Test Library (Darwin)
2020
steps:
2121
- uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
2224
- name: Select Xcode 15.2
2325
run: sudo xcode-select -s /Applications/Xcode_15.2.app
26+
- uses: actions/cache@v3
27+
with:
28+
path: /tmp/derived-data
29+
key: derived-data-cache-
2430
- name: Run tests
2531
run: make test-library
2632

Makefile

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ PLATFORM_MACOS = macOS
33
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
44
PLATFORM_TVOS = tvOS Simulator,name=Apple TV
55
PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 9 (41mm)
6-
EXAMPLE = Examples
76

87
test-all: test-library test-linux
98

109
test-library:
1110
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_WATCHOS)"; do \
12-
xcodebuild test \
13-
-skipMacroValidation \
14-
-workspace supabase-swift.xcworkspace \
15-
-scheme Supabase \
16-
-destination platform="$$platform" || exit 1; \
11+
set -o pipefail && \
12+
xcodebuild test \
13+
-skipMacroValidation \
14+
-workspace supabase-swift.xcworkspace \
15+
-scheme Supabase \
16+
-derivedDataPath /tmp/derived-data \
17+
-destination platform="$$platform" | xcpretty; \
1718
done;
1819

1920
test-linux:
@@ -43,11 +44,12 @@ test-docs:
4344

4445
build-examples:
4546
for scheme in Examples UserManagement SlackClone; do \
46-
xcodebuild build \
47-
-skipMacroValidation \
48-
-workspace supabase-swift.xcworkspace \
49-
-scheme "$$scheme" \
50-
-destination platform="$(PLATFORM_IOS)" || exit 1; \
47+
set -o pipefail && \
48+
xcodebuild build \
49+
-skipMacroValidation \
50+
-workspace supabase-swift.xcworkspace \
51+
-scheme "$$scheme" \
52+
-destination platform="$(PLATFORM_IOS)" | xcpretty; \
5153
done
5254

5355
format:

0 commit comments

Comments
 (0)