Add iOS CI, fix Swift CI

This commit is contained in:
Peter Steinberger 2025-06-20 11:32:59 +02:00
parent 610e3c0c43
commit 72d4bfda5c
3 changed files with 146 additions and 15 deletions

View file

@ -17,6 +17,10 @@ jobs:
name: Swift CI name: Swift CI
uses: ./.github/workflows/swift.yml uses: ./.github/workflows/swift.yml
ios:
name: iOS CI
uses: ./.github/workflows/ios.yml
rust: rust:
name: Rust CI name: Rust CI
uses: ./.github/workflows/rust.yml uses: ./.github/workflows/rust.yml

107
.github/workflows/ios.yml vendored Normal file
View file

@ -0,0 +1,107 @@
name: iOS CI
on:
workflow_call:
permissions:
contents: read
pull-requests: write
issues: write
jobs:
lint:
name: Lint iOS Swift Code
runs-on: macos-15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Select Xcode 16.3
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.3'
- name: Run SwiftLint
run: |
cd ios
if which swiftlint >/dev/null; then
swiftlint lint --reporter github-actions-logging
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
build:
name: Build iOS App
runs-on: macos-15
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Select Xcode 16.3
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.3'
- name: Show build settings
run: |
cd ios
xcodebuild -showBuildSettings -project VibeTunnel.xcodeproj -scheme VibeTunnel -destination generic/platform=iOS
- name: Build iOS app
run: |
cd ios
xcodebuild build \
-project VibeTunnel.xcodeproj \
-scheme VibeTunnel \
-destination "generic/platform=iOS" \
-configuration Release \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
ONLY_ACTIVE_ARCH=NO \
-derivedDataPath build/DerivedData
- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: ios-build-artifacts
path: ios/build/DerivedData/Build/Products/Release-iphoneos/
retention-days: 7
test:
name: Test iOS App
runs-on: macos-15
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Select Xcode 16.3
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.3'
- name: Build and test
run: |
cd ios
# Note: Currently no test targets in the iOS project
# When tests are added, use:
# xcodebuild test \
# -project VibeTunnel.xcodeproj \
# -scheme VibeTunnel \
# -destination "platform=iOS Simulator,OS=18.0,name=iPhone 15" \
# -resultBundlePath TestResults
echo "No test targets found in iOS project"
# Uncomment when tests are added:
# - name: Upload test results
# uses: actions/upload-artifact@v4
# if: failure()
# with:
# name: ios-test-results
# path: ios/TestResults
# retention-days: 7

View file

@ -8,21 +8,22 @@ permissions:
pull-requests: write pull-requests: write
issues: write issues: write
env:
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer
jobs: jobs:
lint: lint:
name: Lint Swift Code name: Lint Swift Code
runs-on: self-hosted runs-on: macos-15
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Xcode - name: Select Xcode 16.3
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.3'
- name: Verify Xcode
run: | run: |
# DEVELOPER_DIR is already set in env, so no need for xcode-select
xcodebuild -version xcodebuild -version
swift --version swift --version
@ -107,15 +108,19 @@ jobs:
build-and-test: build-and-test:
name: Build and Test macOS App name: Build and Test macOS App
runs-on: self-hosted runs-on: macos-15
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Xcode - name: Select Xcode 16.3
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.3'
- name: Verify Xcode
run: | run: |
# DEVELOPER_DIR is already set in env, so no need for xcode-select
xcodebuild -version xcodebuild -version
swift --version swift --version
@ -131,8 +136,17 @@ jobs:
echo "xcbeautify is already installed at: $(which xcbeautify)" echo "xcbeautify is already installed at: $(which xcbeautify)"
fi fi
# Check if go is already installed, install if not
if ! which go >/dev/null 2>&1; then
echo "Installing go..."
brew install go || echo "Failed to install go"
else
echo "go is already installed at: $(which go)"
fi
# Show final status # Show final status
echo "xcbeautify: $(which xcbeautify || echo 'not found')" echo "xcbeautify: $(which xcbeautify || echo 'not found')"
echo "go: $(which go || echo 'not found')"
- name: Setup Rust - name: Setup Rust
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
@ -159,8 +173,10 @@ jobs:
-scheme VibeTunnel \ -scheme VibeTunnel \
-configuration Debug \ -configuration Debug \
-destination "platform=macOS" \ -destination "platform=macOS" \
CODE_SIGN_IDENTITY="" \ CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_REQUIRED=YES \
CODE_SIGN_ENTITLEMENTS="" \
ENABLE_HARDENED_RUNTIME=NO \
| xcbeautify | xcbeautify
- name: Build Release - name: Build Release
@ -172,8 +188,10 @@ jobs:
-scheme VibeTunnel \ -scheme VibeTunnel \
-configuration Release \ -configuration Release \
-destination "platform=macOS" \ -destination "platform=macOS" \
CODE_SIGN_IDENTITY="" \ CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_REQUIRED=YES \
CODE_SIGN_ENTITLEMENTS="" \
ENABLE_HARDENED_RUNTIME=NO \
| xcbeautify | xcbeautify
- name: Run tests - name: Run tests
@ -186,8 +204,10 @@ jobs:
-configuration Debug \ -configuration Debug \
-destination "platform=macOS" \ -destination "platform=macOS" \
-resultBundlePath TestResults \ -resultBundlePath TestResults \
CODE_SIGN_IDENTITY="" \ CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_REQUIRED=YES \
CODE_SIGN_ENTITLEMENTS="" \
ENABLE_HARDENED_RUNTIME=NO \
| xcbeautify | xcbeautify
- name: Upload test results - name: Upload test results