From ed74b06f3e96fddc782c31249490b1d74fb2eb67 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 3 Apr 2024 14:00:39 -0300 Subject: [PATCH] ci: separate into multiple workflows --- .github/workflows/auth.yml | 40 +++++++++++ .github/workflows/ci.yml | 70 ------------------ .github/workflows/integration-tests.yml | 29 ++++++++ .../xcshareddata/xcschemes/Auth.xcscheme | 72 +++++++++++++++++++ .../xcshareddata/xcschemes/Supabase.xcscheme | 2 +- Supabase.xctestplan => AllTests.xctestplan | 0 Auth.xctestplan | 24 +++++++ Makefile | 11 +-- .../contents.xcworkspacedata | 5 +- 9 files changed, 176 insertions(+), 77 deletions(-) create mode 100644 .github/workflows/auth.yml delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/integration-tests.yml create mode 100644 .swiftpm/xcode/xcshareddata/xcschemes/Auth.xcscheme rename Supabase.xctestplan => AllTests.xctestplan (100%) create mode 100644 Auth.xctestplan diff --git a/.github/workflows/auth.yml b/.github/workflows/auth.yml new file mode 100644 index 00000000..90ad5595 --- /dev/null +++ b/.github/workflows/auth.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 815748d5..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: CI - -on: - push: - branches: - - main - pull_request: - branches: - - "*" - workflow_dispatch: - -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true - -jobs: - library-darwin: - runs-on: macos-14 - name: Test Library (Darwin) - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Select Xcode 15.3 - run: sudo xcode-select -s /Applications/Xcode_15.3.app - - uses: actions/cache@v3 - with: - path: /tmp/derived-data - key: derived-data-cache- - - name: Run tests - run: make test-library - - library-evolution: - name: Library (evolution, Darwin) - runs-on: macos-14 - steps: - - uses: actions/checkout@v4 - - name: Select Xcode 15.3 - run: sudo xcode-select -s /Applications/Xcode_15.3.app - - name: Build for library evolution - run: make build-for-library-evolution - - 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 }} - - - examples: - runs-on: macos-14 - name: Build Examples - steps: - - uses: actions/checkout@v3 - - name: Select Xcode 15.3 - run: sudo xcode-select -s /Applications/Xcode_15.3.app - - name: Prepare Examples Project - run: cp Examples/Examples/_Secrets.swift Examples/Examples/Secrets.swift - - name: Build examples - run: make build-examples diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 00000000..233e16e3 --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -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 }} diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/Auth.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/Auth.xcscheme new file mode 100644 index 00000000..8392cfcb --- /dev/null +++ b/.swiftpm/xcode/xcshareddata/xcschemes/Auth.xcscheme @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/Supabase.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/Supabase.xcscheme index f8e4a434..db1bb6e5 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/Supabase.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/Supabase.xcscheme @@ -29,7 +29,7 @@ shouldUseLaunchSchemeArgsEnv = "YES"> 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 && \ diff --git a/supabase-swift.xcworkspace/contents.xcworkspacedata b/supabase-swift.xcworkspace/contents.xcworkspacedata index 2ee9fb56..9c449512 100644 --- a/supabase-swift.xcworkspace/contents.xcworkspacedata +++ b/supabase-swift.xcworkspace/contents.xcworkspacedata @@ -8,9 +8,12 @@ location = "container:Examples/Examples.xcodeproj"> + location = "group:/Users/guilherme/src/github.com/supabase-community/supabase-swift/AllTests.xctestplan"> + +