name: CI on: push: branches: [main, develop] pull_request: branches: [main, develop] workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: # ========================================================= # SwiftLint (light config — fails only on severe issues) # ========================================================= lint: name: SwiftLint runs-on: macos-14 steps: - uses: actions/checkout@v4 - name: Select Xcode run: sudo xcode-select -s /Applications/Xcode_16.0.app - name: Install SwiftLint run: brew install swiftlint - name: Run SwiftLint run: | swiftlint lint --quiet swiftlint lint --quiet --strict # ========================================================= # Build the main app + keyboard extension # ========================================================= build: name: Build (${{ matrix.destination }}) needs: lint runs-on: macos-14 strategy: fail-fast: false matrix: destination: - generic/platform=iOS Simulator xcode: - "16.0" steps: - uses: actions/checkout@v4 - name: Select Xcode ${{ matrix.xcode }} run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - name: Install XcodeGen run: brew install xcodegen - name: Generate project run: xcodegen generate - name: Build run: | set -o pipefail xcodebuild \ -project OSGKeyboard.xcodeproj \ -scheme OSGKeyboard \ -destination "${{ matrix.destination }}" \ -configuration Debug \ build \ | xcpretty # ========================================================= # Unit tests # ========================================================= test: name: Unit tests needs: lint runs-on: macos-14 steps: - 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 project run: xcodegen generate - name: Run tests run: | set -o pipefail xcodebuild test \ -project OSGKeyboard.xcodeproj \ -scheme OSGKeyboard \ -destination 'platform=iOS Simulator,name=iPhone 17' \ -configuration Debug \ -only-testing:OSGKeyboardTests \ CODE_SIGNING_ALLOWED=NO \ | xcpretty