8ce84d2339
Co-authored-by: Rocky <hkgood@users.noreply.github.com>
98 lines
3.1 KiB
YAML
98 lines
3.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [0.1, 0.2, develop]
|
|
pull_request:
|
|
branches: [0.1, 0.2, 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
|
|
# macos-14 runner ships Xcode 16.x (default 16.4 in 2026). We pin to
|
|
# 16.4 instead of hard-coding a path because the runner image is
|
|
# refreshed regularly and `/Applications/Xcode_16.0.app` is no
|
|
# longer pre-installed — that's the bug this PR fixes.
|
|
runs-on: macos-14
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Select Xcode 16.4
|
|
run: sudo xcode-select -s /Applications/Xcode_16.4.app
|
|
- name: Install SwiftLint
|
|
run: brew install swiftlint
|
|
- name: Run SwiftLint
|
|
# Run twice: --quiet to fail on errors only, --strict to fail
|
|
# on warnings too. The current .swiftlint.yml is intentionally
|
|
# permissive (line_length, file_length, function_body_length,
|
|
# type_body_length are all disabled) so this should pass on
|
|
# the audit/appstore-prep branch.
|
|
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
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Select Xcode 16.4
|
|
run: sudo xcode-select -s /Applications/Xcode_16.4.app
|
|
- name: Install XcodeGen
|
|
run: brew install xcodegen
|
|
- name: Generate project
|
|
run: ./Scripts/generate-xcodeproj.sh
|
|
- 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 16.4
|
|
run: sudo xcode-select -s /Applications/Xcode_16.4.app
|
|
- name: Install XcodeGen
|
|
run: brew install xcodegen
|
|
- name: Generate project
|
|
run: ./Scripts/generate-xcodeproj.sh
|
|
- 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
|