-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
154 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ci-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
macos: | ||
name: macOS 13 (Xcode 14.3.1) | ||
runs-on: macos-13 | ||
strategy: | ||
matrix: | ||
config: ['debug', 'release'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Select Xcode 14.3.1 | ||
run: sudo xcode-select -s /Applications/Xcode_14.3.1.app | ||
- name: Run tests | ||
run: make test-swift | ||
- name: Build platforms ${{ matrix.config }} | ||
run: CONFIG=${{ matrix.config }} make build-all-platforms | ||
- name: Build for library evolution | ||
run: make build-for-library-evolution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
CONFIG = debug | ||
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iPhone,iOS-16) | ||
PLATFORM_MACOS = macOS | ||
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst | ||
PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,TV,tvOS-16) | ||
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,Watch,watchOS-9) | ||
|
||
default: test | ||
|
||
build-all-platforms: | ||
for platform in \ | ||
"$(PLATFORM_IOS)" \ | ||
"$(PLATFORM_MACOS)" \ | ||
"$(PLATFORM_MAC_CATALYST)" \ | ||
"$(PLATFORM_TVOS)" \ | ||
"$(PLATFORM_WATCHOS)"; \ | ||
do \ | ||
xcrun xcodebuild build \ | ||
-workspace ComposableUserNotifications.xcworkspace \ | ||
-scheme ComposableUserNotifications \ | ||
-configuration $(CONFIG) \ | ||
-destination platform="$$platform" || exit 1; \ | ||
done; | ||
|
||
test-swift: | ||
swift test | ||
swift test -c release | ||
|
||
build-for-static-stdlib: | ||
@swift build -c debug --static-swift-stdlib | ||
@swift build -c release --static-swift-stdlib | ||
|
||
test-integration: | ||
xcrun xcodebuild test \ | ||
-scheme "Integration" \ | ||
-destination platform="$(PLATFORM_IOS)" || exit 1; \ | ||
|
||
build-for-library-evolution: | ||
swift build \ | ||
-c release \ | ||
--target ComposableUserNotifications \ | ||
-Xswiftc -emit-module-interface \ | ||
-Xswiftc -enable-library-evolution | ||
|
||
build-for-static-stdlib-docker: | ||
@docker run \ | ||
-v "$(PWD):$(PWD)" \ | ||
-w "$(PWD)" \ | ||
swift:5.8-focal \ | ||
bash -c "swift build -c debug --static-swift-stdlib" | ||
@docker run \ | ||
-v "$(PWD):$(PWD)" \ | ||
-w "$(PWD)" \ | ||
swift:5.8-focal \ | ||
bash -c "swift build -c release --static-swift-stdlib" | ||
|
||
format: | ||
swift format \ | ||
--ignore-unparsable-files \ | ||
--in-place \ | ||
--recursive \ | ||
./Package.swift ./Sources ./Tests | ||
|
||
.PHONY: test test-swift build-for-library-evolution format | ||
|
||
define udid_for | ||
$(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') | ||
endef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import CoreLocation | ||
import UserNotifications | ||
import XCTestDynamicOverlay | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters