Skip to content

Simplify CI #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,11 @@ concurrency:

jobs:
library:
strategy:
matrix:
platform:
- iOS Simulator,name=iPhone 14 Pro
- macOS
- macOS,variant=Mac Catalyst
- tvOS Simulator,name=Apple TV
- watchOS Simulator,name=Apple Watch Series 8 (41mm)
runs-on: macos-13
name: Test Library
steps:
- uses: actions/checkout@v3
- name: Select Xcode 14.3
run: sudo xcode-select -s /Applications/Xcode_14.3.app
- name: Run tests
run: env PLATFORM="${{ matrix.platform }}" make test-library

# example:
# strategy:
# matrix:
# platform:
# - iOS Simulator,name=iPhone 14 Pro
# example:
# - Examples
# runs-on: macos-13
# name: Build Example
# steps:
# - uses: actions/checkout@v3
# - name: Select Xcode 14.3
# run: sudo xcode-select -s /Applications/Xcode_14.3.app
# - name: Run pre-build script
# run: sh Examples/${{ matrix.example }}/.ci/pre_build.sh || exit 0;
# - name: Build example
# run: env PLATFORM="${{ matrix.platform }}" EXAMPLE="${{ matrix.example }}" make build-example
run: make test-library
41 changes: 34 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
PLATFORM ?= iOS Simulator,name=iPhone 15 Pro
EXAMPLE ?= Examples
PLATFORM_IOS = iOS Simulator,name=iPhone 14 Pro
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 8 (41mm)
EXAMPLE = Examples

test-library:
xcodebuild test \
-workspace supabase-swift.xcworkspace \
-scheme Supabase-Package \
-destination platform="$(PLATFORM)" || exit 1;
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_WATCHOS)"; do \
xcodebuild test \
-workspace supabase-swift.xcworkspace \
-scheme Supabase-Package \
-destination platform="$$platform" || exit 1; \
done;

build-for-library-evolution:
swift build \
-c release \
--target Supabase \
-Xswiftc -emit-module-interface \
-Xswiftc -enable-library-evolution


DOC_WARNINGS = $(shell xcodebuild clean docbuild \
-scheme Supabase \
-destination platform="$(PLATFORM_MACOS)" \
-quiet \
2>&1 \
| grep "couldn't be resolved to known documentation" \
| sed 's|$(PWD)|.|g' \
| tr '\n' '\1')
test-docs:
@test "$(DOC_WARNINGS)" = "" \
|| (echo "xcodebuild docbuild failed:\n\n$(DOC_WARNINGS)" | tr '\1' '\n' \
&& exit 1)

build-example:
xcodebuild build \
-workspace supabase-swift.xcworkspace \
-scheme "$(EXAMPLE)" \
-destination platform="$(PLATFORM)" || exit 1;
-destination platform="$(PLATFORM_IOS)" || exit 1;

format:
@swiftformat .
Expand Down
4 changes: 1 addition & 3 deletions Sources/GoTrue/GoTrueClient.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Foundation
@_spi(Internal) import _Helpers

public typealias AnyJSON = _Helpers.AnyJSON

#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
Expand Down Expand Up @@ -84,7 +82,7 @@ public actor GoTrueClient {

/// Returns the session, refreshing it if necessary.
///
/// If no session can be found, a ``GoTrueError.sessionNotFound`` error is thrown.
/// If no session can be found, a ``GoTrueError/sessionNotFound`` error is thrown.
public var session: Session {
get async throws {
try await sessionManager.session()
Expand Down
11 changes: 7 additions & 4 deletions Sources/GoTrue/Types.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Foundation
@_spi(Internal) import _Helpers

public typealias AnyJSON = _Helpers.AnyJSON

public enum AuthChangeEvent: String, Sendable {
case initialSession = "INITIAL_SESSION"
Expand Down Expand Up @@ -424,12 +427,12 @@ public struct AuthMFAEnrollResponse: Decodable, Hashable, Sendable {
}

public struct MFAChallengeParams: Encodable, Hashable {
/// ID of the factor to be challenged. Returned in ``GoTrueMFA.enroll(params:)``.
/// ID of the factor to be challenged. Returned in ``GoTrueMFA/enroll(params:)``.
public let factorId: String
}

public struct MFAVerifyParams: Encodable, Hashable {
/// ID of the factor being verified. Returned in ``GoTrueMFA.enroll(params:)``.
/// ID of the factor being verified. Returned in ``GoTrueMFA/enroll(params:)``.
public let factorId: String

/// ID of the challenge being verified. Returned in challenge().
Expand All @@ -440,7 +443,7 @@ public struct MFAVerifyParams: Encodable, Hashable {
}

public struct MFAUnenrollParams: Encodable, Hashable, Sendable {
/// ID of the factor to unenroll. Returned in ``GoTrueMFA.enroll(params:)``.
/// ID of the factor to unenroll. Returned in ``GoTrueMFA/enroll(params:)``.
public let factorId: String

public init(factorId: String) {
Expand All @@ -449,7 +452,7 @@ public struct MFAUnenrollParams: Encodable, Hashable, Sendable {
}

public struct MFAChallengeAndVerifyParams: Encodable, Hashable, Sendable {
/// ID of the factor to be challenged. Returned in ``GoTrueMFA.enroll(params:)``.
/// ID of the factor to be challenged. Returned in ``GoTrueMFA/enroll(params:)``.
public let factorId: String

/// Verification code provided by the user.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Storage/StorageFileApi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public class StorageFileApi: StorageApi {
}

/// Downloads a file from a private bucket. For public buckets, make a request to the URL returned
/// from ``getPublicURL`` instead.
/// from ``StorageFileApi/getPublicURL(path:download:fileName:options:)`` instead.
/// - Parameters:
/// - path: The file path to be downloaded, including the path and file name. For example
/// `folder/image.png`.
Expand Down