Skip to content

Commit

Permalink
ci: cache builds for improve build times (#286)
Browse files Browse the repository at this point in the history
* ci: cache builds for improve build times

* fix cache path

* chore: use xcpretty

* chore: use xcpretty on build-examples make target
  • Loading branch information
grdsdev authored Mar 28, 2024
1 parent 576693e commit 7ef5223
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ jobs:
name: Test Library (Darwin)
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Select Xcode 15.2
run: sudo xcode-select -s /Applications/Xcode_15.2.app
- uses: actions/cache@v3
with:
path: /tmp/derived-data
key: derived-data-cache-
- name: Run tests
run: make test-library

Expand Down
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ 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)
EXAMPLE = Examples

test-all: test-library test-linux

test-library:
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_WATCHOS)"; do \
xcodebuild test \
-skipMacroValidation \
-workspace supabase-swift.xcworkspace \
-scheme Supabase \
-destination platform="$$platform" || exit 1; \
set -o pipefail && \
xcodebuild test \
-skipMacroValidation \
-workspace supabase-swift.xcworkspace \
-scheme Supabase \
-derivedDataPath /tmp/derived-data \
-destination platform="$$platform" | xcpretty; \
done;

test-linux:
Expand Down Expand Up @@ -43,11 +44,12 @@ test-docs:

build-examples:
for scheme in Examples UserManagement SlackClone; do \
xcodebuild build \
-skipMacroValidation \
-workspace supabase-swift.xcworkspace \
-scheme "$$scheme" \
-destination platform="$(PLATFORM_IOS)" || exit 1; \
set -o pipefail && \
xcodebuild build \
-skipMacroValidation \
-workspace supabase-swift.xcworkspace \
-scheme "$$scheme" \
-destination platform="$(PLATFORM_IOS)" | xcpretty; \
done

format:
Expand Down

0 comments on commit 7ef5223

Please sign in to comment.