name: XCUITest CI on: pull_request: push: branches: [ main ] workflow_dispatch: permissions: contents: read jobs: xcuitest: runs-on: macos-15 timeout-minutes: 45 env: XCODE_DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer WORKSPACE: MyApp.xcworkspace SCHEME: MyApp DESTINATION: platform=iOS Simulator,name=iPhone 16,OS=latest RESULT_BUNDLE: TestResults/MyAppUITests.xcresult steps: - uses: actions/checkout@v6 - name: Select Xcode run: | sudo xcode-select -s "$XCODE_DEVELOPER_DIR" xcodebuild -version - name: Show simulator destination run: xcrun simctl list devices available - name: Run XCUITest run: | mkdir -p TestResults xcodebuild test \ -workspace "$WORKSPACE" \ -scheme "$SCHEME" \ -destination "$DESTINATION" \ -only-testing:MyAppUITests \ -derivedDataPath DerivedData \ -resultBundlePath "$RESULT_BUNDLE" - name: Upload XCUITest result bundle if: always() uses: actions/upload-artifact@v7 with: name: xcuitest-result-bundle path: TestResults/MyAppUITests.xcresult if-no-files-found: error