Harden protected TMDb account smoke #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: iOS | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| simulator: | |
| name: iOS simulator build and launch | |
| runs-on: macos-15 | |
| timeout-minutes: 30 | |
| env: | |
| PROJECT: SmartMovie/SmartMovie.xcodeproj | |
| DERIVED_DATA_NAME: SmartMovie-iOS-DerivedData | |
| BUILD_RESULT_NAME: SmartMovie-iOS-Build.xcresult | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| - name: Install SwiftLint | |
| run: brew install swiftlint | |
| - name: Show build tools | |
| run: | | |
| xcodebuild -version | |
| swiftlint version | |
| - name: Enforce SwiftLint | |
| run: swiftlint lint --strict --no-cache | |
| - name: Select an available iPhone simulator | |
| id: simulator | |
| run: | | |
| device_id="$(xcrun simctl list devices available --json | jq -r \ | |
| '[.devices[][] | select(.isAvailable == true and (.name | startswith("iPhone")))] | first | .udid')" | |
| if [[ -z "$device_id" || "$device_id" == "null" ]]; then | |
| echo "No available iPhone simulator was found." >&2 | |
| exit 1 | |
| fi | |
| echo "device_id=$device_id" >> "$GITHUB_OUTPUT" | |
| - name: Build the iOS app for Simulator | |
| run: | | |
| set -o pipefail | |
| xcodebuild build \ | |
| -project "$PROJECT" \ | |
| -scheme SmartMovie \ | |
| -configuration Debug \ | |
| -destination "platform=iOS Simulator,id=${{ steps.simulator.outputs.device_id }}" \ | |
| -derivedDataPath "$RUNNER_TEMP/$DERIVED_DATA_NAME" \ | |
| -resultBundlePath "$RUNNER_TEMP/$BUILD_RESULT_NAME" \ | |
| CODE_SIGNING_ALLOWED=NO | |
| - name: Launch smoke test | |
| env: | |
| DEVICE_ID: ${{ steps.simulator.outputs.device_id }} | |
| run: | | |
| app_path="$RUNNER_TEMP/$DERIVED_DATA_NAME/Build/Products/Debug-iphonesimulator/SmartMovie.app" | |
| if [[ ! -d "$app_path" ]]; then | |
| echo "Built SmartMovie.app was not found at $app_path" >&2 | |
| exit 1 | |
| fi | |
| xcrun simctl boot "$DEVICE_ID" 2>/dev/null || true | |
| xcrun simctl bootstatus "$DEVICE_ID" -b | |
| xcrun simctl install "$DEVICE_ID" "$app_path" | |
| xcrun simctl launch "$DEVICE_ID" LamNDT.SmartMovie | |
| sleep 2 | |
| xcrun simctl terminate "$DEVICE_ID" LamNDT.SmartMovie | |
| - name: Upload failed iOS result bundles | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ios-result-bundles | |
| path: | | |
| ${{ runner.temp }}/${{ env.BUILD_RESULT_NAME }} | |
| if-no-files-found: ignore | |
| retention-days: 7 |