This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
name: iOS build and tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ios-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
simulator:
|
||||
runs-on: macos-15
|
||||
timeout-minutes: 25
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Inspect toolchain and project
|
||||
run: |
|
||||
xcodebuild -version
|
||||
swift --version
|
||||
python3 tools/validate_project.py
|
||||
xcodebuild -list -project MusicBridge.xcodeproj
|
||||
- name: Choose available iPhone simulator
|
||||
run: |
|
||||
xcrun simctl list devices available --json > /tmp/musicbridge-simulators.json
|
||||
python3 tools/select_simulator.py /tmp/musicbridge-simulators.json >> "$GITHUB_ENV"
|
||||
- name: Build and run XCTest
|
||||
shell: bash
|
||||
run: |
|
||||
set -o pipefail
|
||||
mkdir -p build
|
||||
xcodebuild test \
|
||||
-project MusicBridge.xcodeproj \
|
||||
-scheme MusicBridge \
|
||||
-configuration Debug \
|
||||
-destination "platform=iOS Simulator,id=$SIMULATOR_ID" \
|
||||
-destination-timeout 120 \
|
||||
-derivedDataPath DerivedData \
|
||||
-resultBundlePath build/MusicBridge.xcresult \
|
||||
CODE_SIGNING_ALLOWED=NO \
|
||||
| tee build/xcodebuild.log
|
||||
- name: Save diagnostics
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ios-test-results
|
||||
path: |
|
||||
build/xcodebuild.log
|
||||
build/MusicBridge.xcresult
|
||||
if-no-files-found: warn
|
||||
retention-days: 7
|
||||
- name: Archive simulator application
|
||||
run: ditto -c -k --sequesterRsrc --keepParent DerivedData/Build/Products/Debug-iphonesimulator/MusicBridge.app build/MusicBridge-simulator.zip
|
||||
- name: Save simulator application
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MusicBridge-simulator
|
||||
path: build/MusicBridge-simulator.zip
|
||||
retention-days: 7
|
||||
Reference in New Issue
Block a user