Target iOS 18.5 to match available simulator runtime #22
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, master, develop, 'feature/**', 'claude/**'] | |
| pull_request: | |
| branches: [main, master, develop] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| DEVELOPER_DIR: /Applications/Xcode_16.0.app/Contents/Developer | |
| SIMULATOR_NAME: "iPhone 16 Pro" | |
| jobs: | |
| # Linting job | |
| lint: | |
| name: Lint | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install SwiftLint | |
| run: brew install swiftlint | |
| - name: Run SwiftLint | |
| run: swiftlint lint --reporter github-actions-logging | |
| continue-on-error: true | |
| # Swift Format Check | |
| format: | |
| name: Format Check | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install swift-format | |
| run: brew install swift-format | |
| - name: Check formatting | |
| run: | | |
| swift-format lint --recursive Trivit/ TrivitTests/ TrivitUITests/ || { | |
| echo "::warning::Code is not properly formatted. Run 'swift-format format --recursive --in-place Trivit/' to fix." | |
| } | |
| continue-on-error: true | |
| # Build and Test - iOS | |
| build-and-test-ios: | |
| name: Build and Test (iOS) | |
| runs-on: macos-15 | |
| needs: [lint] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.0.app | |
| - name: Install XcodeGen | |
| run: brew install xcodegen | |
| - name: Generate Xcode project | |
| run: xcodegen generate | |
| - name: Show Xcode version | |
| run: xcodebuild -version | |
| - name: List available simulators | |
| run: | | |
| echo "=== Available Simulator Runtimes ===" | |
| xcrun simctl list runtimes | |
| echo "=== Available iPhone Simulators ===" | |
| xcrun simctl list devices available | grep -E "iPhone" | head -20 | |
| - name: Build | |
| run: | | |
| set -o pipefail | |
| xcodebuild build-for-testing \ | |
| -project Trivit.xcodeproj \ | |
| -scheme Trivit \ | |
| -sdk iphonesimulator \ | |
| -destination "platform=iOS Simulator,name=iPhone 16 Pro" \ | |
| -configuration Debug \ | |
| CODE_SIGN_IDENTITY="" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| IPHONEOS_DEPLOYMENT_TARGET=18.5 \ | |
| | xcpretty | |
| - name: Run Unit Tests | |
| run: | | |
| set -o pipefail | |
| xcodebuild test \ | |
| -project Trivit.xcodeproj \ | |
| -scheme Trivit \ | |
| -sdk iphonesimulator \ | |
| -destination "platform=iOS Simulator,name=iPhone 16 Pro" \ | |
| -enableCodeCoverage YES \ | |
| -resultBundlePath TestResults-iOS \ | |
| CODE_SIGN_IDENTITY="" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| IPHONEOS_DEPLOYMENT_TARGET=18.5 \ | |
| | xcpretty --report junit || echo "Tests failed or no compatible simulator found" | |
| continue-on-error: true | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results-ios | |
| path: | | |
| TestResults-iOS | |
| build/reports/ | |
| # Build for macOS | |
| build-macos: | |
| name: Build (macOS) | |
| runs-on: macos-15 | |
| needs: [lint] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.0.app | |
| - name: Install XcodeGen | |
| run: brew install xcodegen | |
| - name: Generate Xcode project | |
| run: xcodegen generate | |
| - name: Build for macOS | |
| run: | | |
| set -o pipefail | |
| xcodebuild build \ | |
| -project Trivit.xcodeproj \ | |
| -scheme Trivit-macOS \ | |
| -destination "platform=macOS" \ | |
| -configuration Debug \ | |
| CODE_SIGN_IDENTITY="" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| | xcpretty | |
| continue-on-error: true | |
| # UI Tests - iPhone | |
| ui-tests-iphone: | |
| name: UI Tests (iPhone) | |
| runs-on: macos-15 | |
| needs: [build-and-test-ios] | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.0.app | |
| - name: Install XcodeGen | |
| run: brew install xcodegen | |
| - name: Generate Xcode project | |
| run: xcodegen generate | |
| - name: Boot Simulator | |
| run: | | |
| xcrun simctl boot "iPhone 16 Pro" || true | |
| - name: Run iPhone UI Tests | |
| run: | | |
| set -o pipefail | |
| xcodebuild test \ | |
| -project Trivit.xcodeproj \ | |
| -scheme Trivit \ | |
| -sdk iphonesimulator \ | |
| -destination "platform=iOS Simulator,name=iPhone 16 Pro" \ | |
| -resultBundlePath UITestResults-iPhone \ | |
| -only-testing:TrivitUITests \ | |
| CODE_SIGN_IDENTITY="" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| IPHONEOS_DEPLOYMENT_TARGET=18.5 \ | |
| | xcpretty | |
| continue-on-error: true | |
| - name: Upload iPhone UI test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: ui-test-results-iphone | |
| path: UITestResults-iPhone | |
| # Security audit | |
| security-audit: | |
| name: Security Audit | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Check for security issues | |
| run: | | |
| echo "Checking for hardcoded secrets..." | |
| if grep -rn "API_KEY\|SECRET\|PASSWORD\|TOKEN" --include="*.swift" Trivit/ 2>/dev/null | grep -v "// " | grep -v "Description"; then | |
| echo "::warning::Potential hardcoded secrets found" | |
| fi | |
| echo "Security audit complete" |