84 lines
2.3 KiB
YAML
84 lines
2.3 KiB
YAML
name: Build EdgeEver iOS
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "apps/ios/**"
|
|
- ".github/workflows/ios-build.yml"
|
|
pull_request:
|
|
paths:
|
|
- "apps/ios/**"
|
|
- ".github/workflows/ios-build.yml"
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: edgeever-ios-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-and-test:
|
|
if: github.repository == 'tianma-if/edgeever'
|
|
name: Xcode build + unit tests
|
|
runs-on: macos-15
|
|
timeout-minutes: 45
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Select Xcode
|
|
run: |
|
|
sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer || \
|
|
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
|
|
xcodebuild -version
|
|
|
|
- name: Install XcodeGen
|
|
run: brew install xcodegen
|
|
|
|
- name: Generate project
|
|
working-directory: apps/ios
|
|
run: xcodegen generate
|
|
|
|
- name: Resolve packages
|
|
working-directory: apps/ios
|
|
run: |
|
|
xcodebuild -project EdgeEver.xcodeproj -scheme EdgeEver \
|
|
-resolvePackageDependencies \
|
|
-destination 'generic/platform=iOS Simulator'
|
|
|
|
- name: Build
|
|
working-directory: apps/ios
|
|
run: |
|
|
set -o pipefail
|
|
xcodebuild build \
|
|
-project EdgeEver.xcodeproj \
|
|
-scheme EdgeEver \
|
|
-destination 'generic/platform=iOS Simulator' \
|
|
CODE_SIGNING_ALLOWED=NO \
|
|
| xcpretty || true
|
|
xcodebuild build \
|
|
-project EdgeEver.xcodeproj \
|
|
-scheme EdgeEver \
|
|
-destination 'generic/platform=iOS Simulator' \
|
|
CODE_SIGNING_ALLOWED=NO
|
|
|
|
- name: Test
|
|
working-directory: apps/ios
|
|
run: |
|
|
DEST="$(
|
|
xcodebuild -project EdgeEver.xcodeproj -scheme EdgeEver -showdestinations 2>/dev/null \
|
|
| sed -n 's/.*name:\(iPhone[^,}]*\).*/\1/p' \
|
|
| head -1
|
|
)"
|
|
if [[ -z "$DEST" ]]; then
|
|
DEST="iPhone 16"
|
|
fi
|
|
echo "Using simulator: $DEST"
|
|
xcodebuild test \
|
|
-project EdgeEver.xcodeproj \
|
|
-scheme EdgeEver \
|
|
-destination "platform=iOS Simulator,name=$DEST" \
|
|
CODE_SIGNING_ALLOWED=NO \
|
|
-only-testing:EdgeEverTests
|