mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-21 13:55:54 +00:00
Add iOS CI, fix Swift CI
This commit is contained in:
parent
610e3c0c43
commit
72d4bfda5c
3 changed files with 146 additions and 15 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
|
@ -17,6 +17,10 @@ jobs:
|
|||
name: Swift CI
|
||||
uses: ./.github/workflows/swift.yml
|
||||
|
||||
ios:
|
||||
name: iOS CI
|
||||
uses: ./.github/workflows/ios.yml
|
||||
|
||||
rust:
|
||||
name: Rust CI
|
||||
uses: ./.github/workflows/rust.yml
|
||||
|
|
|
|||
107
.github/workflows/ios.yml
vendored
Normal file
107
.github/workflows/ios.yml
vendored
Normal 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
|
||||
50
.github/workflows/swift.yml
vendored
50
.github/workflows/swift.yml
vendored
|
|
@ -8,21 +8,22 @@ permissions:
|
|||
pull-requests: write
|
||||
issues: write
|
||||
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint Swift Code
|
||||
runs-on: self-hosted
|
||||
runs-on: macos-15
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
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: |
|
||||
# DEVELOPER_DIR is already set in env, so no need for xcode-select
|
||||
xcodebuild -version
|
||||
swift --version
|
||||
|
||||
|
|
@ -107,15 +108,19 @@ jobs:
|
|||
|
||||
build-and-test:
|
||||
name: Build and Test macOS App
|
||||
runs-on: self-hosted
|
||||
runs-on: macos-15
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
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: |
|
||||
# DEVELOPER_DIR is already set in env, so no need for xcode-select
|
||||
xcodebuild -version
|
||||
swift --version
|
||||
|
||||
|
|
@ -131,8 +136,17 @@ jobs:
|
|||
echo "xcbeautify is already installed at: $(which xcbeautify)"
|
||||
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
|
||||
echo "xcbeautify: $(which xcbeautify || echo 'not found')"
|
||||
echo "go: $(which go || echo 'not found')"
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
|
@ -159,8 +173,10 @@ jobs:
|
|||
-scheme VibeTunnel \
|
||||
-configuration Debug \
|
||||
-destination "platform=macOS" \
|
||||
CODE_SIGN_IDENTITY="" \
|
||||
CODE_SIGNING_REQUIRED=NO \
|
||||
CODE_SIGN_IDENTITY="-" \
|
||||
CODE_SIGNING_REQUIRED=YES \
|
||||
CODE_SIGN_ENTITLEMENTS="" \
|
||||
ENABLE_HARDENED_RUNTIME=NO \
|
||||
| xcbeautify
|
||||
|
||||
- name: Build Release
|
||||
|
|
@ -172,8 +188,10 @@ jobs:
|
|||
-scheme VibeTunnel \
|
||||
-configuration Release \
|
||||
-destination "platform=macOS" \
|
||||
CODE_SIGN_IDENTITY="" \
|
||||
CODE_SIGNING_REQUIRED=NO \
|
||||
CODE_SIGN_IDENTITY="-" \
|
||||
CODE_SIGNING_REQUIRED=YES \
|
||||
CODE_SIGN_ENTITLEMENTS="" \
|
||||
ENABLE_HARDENED_RUNTIME=NO \
|
||||
| xcbeautify
|
||||
|
||||
- name: Run tests
|
||||
|
|
@ -186,8 +204,10 @@ jobs:
|
|||
-configuration Debug \
|
||||
-destination "platform=macOS" \
|
||||
-resultBundlePath TestResults \
|
||||
CODE_SIGN_IDENTITY="" \
|
||||
CODE_SIGNING_REQUIRED=NO \
|
||||
CODE_SIGN_IDENTITY="-" \
|
||||
CODE_SIGNING_REQUIRED=YES \
|
||||
CODE_SIGN_ENTITLEMENTS="" \
|
||||
ENABLE_HARDENED_RUNTIME=NO \
|
||||
| xcbeautify
|
||||
|
||||
- name: Upload test results
|
||||
|
|
|
|||
Loading…
Reference in a new issue