feat(supabase): consolidate client metadata into structured X-Client-Info header #1847
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release/* | |
| pull_request: | |
| branches: | |
| - "*" | |
| - release/* | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| macos: | |
| name: xcodebuild (macOS latest) | |
| runs-on: macos-26 | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| command: [test, ""] | |
| platform: [IOS, MACOS] | |
| xcode: ["26.4"] | |
| include: | |
| - { command: test, skip_release: 1 } | |
| - { command: "", skip_debug: 1 } | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Cache derived data | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: ~/.derivedData | |
| key: | | |
| deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-${{ hashFiles('**/Package.resolved') }} | |
| restore-keys: | | |
| deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}- | |
| deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}- | |
| - name: Select Xcode ${{ matrix.xcode }} | |
| run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app | |
| - name: List available devices | |
| run: xcrun simctl list devices available | |
| - 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@d186aca54f8760da4dec55313195e51ed3ebb0b3 # v2.3 | |
| - name: Debug | |
| if: matrix.skip_debug != '1' | |
| run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" xcodebuild | |
| - name: Release | |
| if: matrix.skip_release != '1' | |
| run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Release PLATFORM="${{ matrix.platform }}" xcodebuild | |
| - name: Install lcov | |
| if: matrix.command == 'test' && matrix.platform == 'IOS' | |
| run: brew install lcov | |
| - name: Export code coverage | |
| id: coverage | |
| if: matrix.command == 'test' && matrix.platform == 'IOS' | |
| run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" coverage | |
| - uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7 | |
| if: steps.coverage.outcome == 'success' | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| file: lcov.info | |
| macos-legacy: | |
| name: xcodebuild (macOS legacy) | |
| runs-on: macos-14 | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| command: [test, ""] | |
| platform: [IOS, MACOS, MAC_CATALYST] | |
| xcode: ["15.4"] | |
| include: | |
| - { command: test, skip_release: 1 } | |
| - { command: "", skip_debug: 1 } | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Cache derived data | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: | | |
| ~/.derivedData | |
| key: | | |
| deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-${{ hashFiles('**/Package.resolved') }} | |
| restore-keys: | | |
| deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}- | |
| deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}- | |
| - name: Select Xcode ${{ matrix.xcode }} | |
| run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app | |
| - name: List available devices | |
| run: xcrun simctl list devices available | |
| - 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@d186aca54f8760da4dec55313195e51ed3ebb0b3 # v2.3 | |
| - name: Debug | |
| if: matrix.skip_debug != '1' | |
| run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" xcodebuild | |
| - name: Release | |
| if: matrix.skip_release != '1' | |
| run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Release PLATFORM="${{ matrix.platform }}" xcodebuild | |
| spm: | |
| runs-on: macos-26 | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| config: [debug, release] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: .build | |
| key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-spm- | |
| - run: swift build -c ${{ matrix.config }} | |
| linux: | |
| name: Linux | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: "Cache Swift Package" | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: .build | |
| key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-spm- | |
| - name: "Build Swift Package" | |
| run: swift build | |
| - name: "Test Swift Package" | |
| run: swift test --skip IntegrationTests | |
| integration-tests: | |
| name: Integration Tests (Linux) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: "Cache Swift Package" | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: .build | |
| key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-spm- | |
| - name: "Setup Supabase CLI" | |
| uses: supabase/setup-cli@b60b5899c73b63a2d2d651b1e90db8d4c9392f51 # v1.6.0 | |
| with: | |
| version: latest | |
| - name: "Start Supabase" | |
| working-directory: Tests/IntegrationTests | |
| run: supabase start | |
| - name: "Reset Database" | |
| working-directory: Tests/IntegrationTests | |
| run: supabase db reset | |
| - name: "Run Integration Tests" | |
| env: | |
| INTEGRATION_TESTS: 1 | |
| run: swift test --filter IntegrationTests | |
| - name: "Stop Supabase" | |
| working-directory: Tests/IntegrationTests | |
| if: always() | |
| run: supabase stop | |
| # android: | |
| # name: Android | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v6 | |
| # - name: "Remove IntegrationTests" | |
| # run: rm -r Tests/IntegrationTests/* | |
| # - name: "Test Swift Package" | |
| # uses: skiptools/swift-android-action@v2 | |
| # with: | |
| # # need to copy over the Tests folder because it contains __Snapshots__ | |
| # copy-files: Tests | |
| # # tests are not yet passing on Android | |
| # run-tests: false | |
| library-evolution: | |
| name: Library (evolution) | |
| runs-on: macos-26 | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| xcode: ["26.4"] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Cache derived data | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: ~/.derivedData | |
| key: | | |
| deriveddata-library-evolution-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }} | |
| restore-keys: | | |
| deriveddata-library-evolution-${{ matrix.xcode }}- | |
| deriveddata-library-evolution- | |
| - name: Select Xcode ${{ matrix.xcode }} | |
| run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app | |
| - name: Build for library evolution | |
| run: make build-for-library-evolution | |
| examples: | |
| name: Examples (${{ matrix.scheme }}) | |
| runs-on: macos-26 | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| scheme: [Examples, SlackClone, UserManagement] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Cache derived data | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: ~/.derivedData | |
| key: | | |
| deriveddata-examples-${{ matrix.scheme }}-${{ hashFiles('**/Package.resolved') }} | |
| restore-keys: | | |
| deriveddata-examples-${{ matrix.scheme }}- | |
| deriveddata-examples- | |
| - name: Select Xcode 26.4 | |
| run: sudo xcode-select -s /Applications/Xcode_26.4.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@d186aca54f8760da4dec55313195e51ed3ebb0b3 # v2.3 | |
| - name: Build ${{ matrix.scheme }} | |
| run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="${{ matrix.scheme }}" XCODEBUILD_ARGUMENT=build xcodebuild | |
| docs: | |
| name: Test docs | |
| runs-on: macos-26 | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Cache Swift build | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: .build | |
| key: | | |
| docs-${{ runner.os }}-${{ hashFiles('**/Package.resolved') }} | |
| restore-keys: | | |
| docs-${{ runner.os }}- | |
| - name: Test docs | |
| run: make test-docs | |
| format-check: | |
| name: Format check (changed files only) | |
| if: github.event_name == 'pull_request' | |
| runs-on: macos-26 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get changed Swift files | |
| id: changed-files | |
| run: | | |
| # Get list of changed Swift files in this PR | |
| git fetch origin ${{ github.base_ref }} | |
| CHANGED_FILES=$(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD | grep '\.swift$' || true) | |
| if [ -z "$CHANGED_FILES" ]; then | |
| echo "No Swift files changed" | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "Changed Swift files:" | |
| echo "$CHANGED_FILES" | |
| echo "$CHANGED_FILES" > changed_files.txt | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Check formatting | |
| if: steps.changed-files.outputs.has_changes == 'true' | |
| run: | | |
| # Format only the changed files | |
| while IFS= read -r file; do | |
| if [ -f "$file" ]; then | |
| swift format --in-place "$file" | |
| fi | |
| done < changed_files.txt | |
| # Check if formatting made any changes | |
| if ! git diff --exit-code; then | |
| echo "❌ Some files are not formatted correctly." | |
| echo "📝 Please run 'make format' locally on the changed files and commit the changes." | |
| echo "" | |
| echo "Files that need formatting:" | |
| git diff --name-only | |
| exit 1 | |
| else | |
| echo "✅ All changed Swift files are properly formatted" | |
| fi | |
| ci-success: | |
| name: CI Success | |
| if: always() | |
| needs: [macos, macos-legacy, spm, linux, integration-tests, library-evolution, examples, docs, format-check] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check all jobs | |
| run: | | |
| # Check if any required job failed | |
| RESULTS='${{ toJSON(needs) }}' | |
| echo "Job results:" | |
| echo "$RESULTS" | jq -r 'to_entries[] | "\(.key): \(.value.result)"' | |
| # Fail if any job failed (but allow skipped jobs) | |
| if echo "$RESULTS" | jq -e 'to_entries[] | select(.value.result == "failure")' > /dev/null; then | |
| echo "" | |
| echo "❌ One or more CI jobs failed" | |
| exit 1 | |
| elif echo "$RESULTS" | jq -e 'to_entries[] | select(.value.result == "cancelled")' > /dev/null; then | |
| echo "" | |
| echo "⚠️ One or more CI jobs were cancelled" | |
| exit 1 | |
| else | |
| echo "" | |
| echo "✅ All CI jobs passed successfully" | |
| fi |