Mike/clerk refactor #302
Workflow file for this run
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 | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| format-and-lint: | |
| name: Check formatting and linting | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install SwiftFormat | |
| run: brew install swiftformat | |
| - name: Install SwiftLint | |
| run: brew install swiftlint | |
| - name: Check formatting and linting | |
| run: | | |
| set -euo pipefail | |
| git config core.autocrlf false | |
| git config core.eol lf | |
| make check | |
| build: | |
| name: Build ${{ matrix.platform }} | |
| needs: [test, test-integration] | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| platform: [iOS, macOS, macCatalyst, watchOS, tvOS, visionOS] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Verify macOS and Xcode version | |
| run: | | |
| sw_vers | |
| xcodebuild -version | |
| - name: Build for ${{ matrix.platform }} | |
| run: | | |
| set -euo pipefail | |
| echo "Building for ${{ matrix.platform }} using xcodebuild..." | |
| case "${{ matrix.platform }}" in | |
| iOS) destination="platform=iOS Simulator,name=iPhone 16,OS=18.6" ;; | |
| macOS) destination="platform=macOS" ;; | |
| macCatalyst) destination="platform=macOS,variant=Mac Catalyst" ;; | |
| watchOS) destination="platform=watchOS Simulator,name=Apple Watch Series 10 (42mm),OS=11.5" ;; | |
| tvOS) destination="platform=tvOS Simulator,name=Apple TV,OS=18.5" ;; | |
| visionOS) destination="platform=visionOS Simulator,name=Apple Vision Pro,OS=2.5" ;; | |
| esac | |
| xcodebuild build -workspace Clerk.xcworkspace -scheme ClerkKit -destination "$destination" | |
| test: | |
| name: Run unit tests on macOS | |
| needs: format-and-lint | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Verify macOS and Xcode version | |
| run: | | |
| sw_vers | |
| xcodebuild -version | |
| - name: Cache Swift dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: .build | |
| key: swiftpm-macOS-${{ hashFiles('Package.resolved') }} | |
| restore-keys: swiftpm-macOS- | |
| - name: Run unit tests | |
| run: make test-unit | |
| test-integration: | |
| name: Run integration tests on macOS | |
| needs: test | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Verify macOS and Xcode version | |
| run: | | |
| sw_vers | |
| xcodebuild -version | |
| - name: Cache Swift dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: .build | |
| key: swiftpm-macOS-${{ hashFiles('Package.resolved') }} | |
| restore-keys: swiftpm-macOS- | |
| - name: Run integration tests | |
| run: make test-integration | |
| env: | |
| CLERK_INTEGRATION_TEST_PUBLISHABLE_KEY: ${{ secrets.CLERK_INTEGRATION_TEST_PUBLISHABLE_KEY }} | |
| continue-on-error: true |