Skip to content

Commit

Permalink
ci: separate into multiple workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev committed Apr 3, 2024
1 parent 14e68f2 commit ed74b06
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 77 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Auth

on:
pull_request:
paths:
- "Sources/Auth/**"
- "Tests/Auth/**"
push:
branches:
- main
paths:
- "Sources/Auth/**"
- "Tests/Auth/**"

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test Auth
strategy:
fail-fast: false
matrix:
platform:
- macOS
- macOS,variant=Mac Catalyst
- iOS Simulator,name=iPhone 15 Pro
- tvOS Simulator,name=Apple TV
- watchOS Simulator,name=Apple Watch Series 9 (41mm)
- visionOS Simulator,name=Any visionOS Simulator Device
runs-on: macos-14
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Select Xcode 15.3
run: sudo xcode-select -s /Applications/Xcode_15.3.app
- name: Run tests
run: PLATFORM=${{ matrix.platform }} SCHEME=Auth make test-library
70 changes: 0 additions & 70 deletions .github/workflows/ci.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Integration Tests

on:
push:
branches:
- main
- release/*
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
integration-tests:
runs-on: macos-14
name: Integration Tests
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Select Xcode 15.3
run: sudo xcode-select -s /Applications/Xcode_15.3.app
- name: Run tests
run: make test-integration
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_KEY: ${{ secrets.SUPABASE_SERVICE_KEY }}
72 changes: 72 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/Auth.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Auth"
BuildableName = "Auth"
BlueprintName = "Auth"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:Auth.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Auth"
BuildableName = "Auth"
BlueprintName = "Auth"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion .swiftpm/xcode/xcshareddata/xcschemes/Supabase.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:Supabase.xctestplan"
reference = "container:AllTests.xctestplan"
default = "YES">
</TestPlanReference>
<TestPlanReference
Expand Down
File renamed without changes.
24 changes: 24 additions & 0 deletions Auth.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"configurations" : [
{
"id" : "CB7AE2C5-B36E-4571-9927-9EE60FC5BB1A",
"name" : "Test Scheme Action",
"options" : {

}
}
],
"defaultOptions" : {
"codeCoverage" : false
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:",
"identifier" : "AuthTests",
"name" : "AuthTests"
}
}
],
"version" : 1
}
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@ PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
PLATFORM_TVOS = tvOS Simulator,name=Apple TV
PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 9 (41mm)

SCHEME ?= Supabase
PLATFORM ?= iOS Simulator,name=iPhone 15 Pro

set-env:
@source scripts/setenv.sh > Tests/IntegrationTests/Environment.swift

test-all: test-library test-linux

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

test-integration: set-env
@set -o pipefail && \
Expand Down
5 changes: 4 additions & 1 deletion supabase-swift.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ed74b06

Please sign in to comment.