Skip to content

Commit

Permalink
add build examples job
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev committed Sep 30, 2024
1 parent d9180dd commit 2761c40
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 54 deletions.
61 changes: 26 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,38 +55,29 @@ jobs:
# - name: Build for library evolution
# run: make build-for-library-evolution

# examples:
# name: Examples
# runs-on: macos-14
# steps:
# - uses: actions/checkout@v4
# - name: Cache derived data
# uses: actions/cache@v3
# with:
# path: ~/.derivedData
# key: |
# deriveddata-examples-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift', '**/Examples/**/*.swift') }}
# restore-keys: |
# deriveddata-examples-
# - name: Select Xcode 16
# run: sudo xcode-select -s /Applications/Xcode_16.0.app
# - name: Set IgnoreFileSystemDeviceInodeChanges flag
# run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
# - name: Update mtime for incremental builds
# uses: chetan/git-restore-mtime-action@v2
# - name: CaseStudies (SwiftUI)
# run: make SCHEME="CaseStudies (SwiftUI)" test-example
# - name: CaseStudies (UIKit)
# run: make SCHEME="CaseStudies (UIKit)" test-example
# - name: Search
# run: make SCHEME="Search" test-example
# - name: SyncUps
# run: make SCHEME="SyncUps" test-example
# - name: SpeechRecognition
# run: make SCHEME="SpeechRecognition" test-example
# - name: TicTacToe
# run: make SCHEME="TicTacToe" test-example
# - name: Todos
# run: make SCHEME="Todos" test-example
# - name: VoiceMemos
# run: make SCHEME="VoiceMemos" test-example
examples:
name: Examples
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Cache derived data
uses: actions/cache@v3
with:
path: ~/.derivedData
key: |
deriveddata-examples-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift', '**/Examples/**/*.swift') }}
restore-keys: |
deriveddata-examples-
- name: Select Xcode 16
run: sudo xcode-select -s /Applications/Xcode_16.app
- name: Set IgnoreFileSystemDeviceInodeChanges flag
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
- name: Update mtime for incremental builds
uses: chetan/git-restore-mtime-action@v2
- name: Examples
run: make SCHEME="Examples" test-example
- name: SlackClone
run: make SCHEME="SlackClone" test-example
- name: UserManagement
run: make SCHEME="UserManagement" test-example

26 changes: 7 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,6 @@ build-all-platforms:
-destination platform="$$platform" | xcpretty || exit 1; \
done

test-library: dot-env
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_VISIONOS)" "$(PLATFORM_WATCHOS)"; do \
xcodebuild test \
-skipMacroValidation \
-configuration "$(CONFIG)" \
-workspace Supabase.xcworkspace \
-scheme "$(SCHEME)" \
-destination platform="$$platform" | xcpretty || exit 1; \
done

test-auth:
$(MAKE) SCHEME=Auth test-library

Expand Down Expand Up @@ -151,15 +141,13 @@ test-docs:
|| (echo "xcodebuild docbuild failed:\n\n$(DOC_WARNINGS)" | tr '\1' '\n' \
&& exit 1)

build-examples:
for scheme in Examples UserManagement SlackClone; do \
set -o pipefail && \
xcodebuild build \
-skipMacroValidation \
-workspace Supabase.xcworkspace \
-scheme "$$scheme" \
-destination platform="$(PLATFORM_IOS)" | xcpretty; \
done
build-example:
xcodebuild build \
-skipMacroValidation \
-workspace Supabase.xcworkspace \
-scheme "$(SCHEME)" \
-destination platform="$(PLATFORM_IOS)" \
-derivedDataPath ~/.derivedData | xcpretty;

format:
@swiftformat .
Expand Down

0 comments on commit 2761c40

Please sign in to comment.