ci: pin cache actions in iOS workflows #3
Workflow file for this run
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 Runner Prebuild (CI-only) | ||
|
Check failure on line 1 in .github/workflows/ios-runner-prebuild.yml
|
||
| on: | ||
| workflow_dispatch: | ||
| permissions: | ||
| contents: read | ||
| concurrency: | ||
| group: ci-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| prebuild-ios-runner: | ||
| name: Build iOS 26.2 Prebuilt | ||
| runs-on: macos-26 | ||
| timeout-minutes: 60 | ||
| env: | ||
| IOS_RUNTIME_VERSION: '26.2' | ||
| IOS_DEVICE_NAME: 'iPhone 17 Pro' | ||
| PREBUILT_DIR: ${{ runner.temp }}/ios-runner-prebuilt | ||
| DERIVED_DATA_PATH: ${{ runner.temp }}/ios-runner-derived | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - name: Setup toolchain | ||
| uses: ./.github/actions/setup-node-pnpm | ||
| - name: Resolve Xcode cache key | ||
| id: xcode | ||
| run: | | ||
| set -euo pipefail | ||
| XCODE_VERSION="$(xcodebuild -version | tr '\n' ' ' | sed -E 's/[[:space:]]+/ /g; s/[[:space:]]$//')" | ||
| XCODE_KEY="$(echo "$XCODE_VERSION" | tr ' ' '-' | tr -cd '[:alnum:]._-')" | ||
| echo "version=$XCODE_VERSION" >> "$GITHUB_OUTPUT" | ||
| echo "key=$XCODE_KEY" >> "$GITHUB_OUTPUT" | ||
| - name: Restore prebuilt cache | ||
| id: restore-prebuilt | ||
| uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.3 | ||
| with: | ||
| path: ${{ env.PREBUILT_DIR }} | ||
| key: ios-runner-prebuilt-${{ steps.xcode.outputs.key }}-ios-${{ env.IOS_RUNTIME_VERSION }} | ||
| - name: Build ios-runner for testing | ||
| if: steps.restore-prebuilt.outputs.cache-hit != 'true' | ||
| run: | | ||
| set -euo pipefail | ||
| rm -rf "$DERIVED_DATA_PATH" "$PREBUILT_DIR" | ||
| xcodebuild build-for-testing \ | ||
| -project ios-runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj \ | ||
| -scheme AgentDeviceRunner \ | ||
| -destination "platform=iOS Simulator,name=${IOS_DEVICE_NAME},OS=${IOS_RUNTIME_VERSION}" \ | ||
| -derivedDataPath "$DERIVED_DATA_PATH" | ||
| - name: Package prebuilt cache payload | ||
| if: steps.restore-prebuilt.outputs.cache-hit != 'true' | ||
| run: | | ||
| set -euo pipefail | ||
| mkdir -p "$PREBUILT_DIR" | ||
| cp -R "$DERIVED_DATA_PATH" "$PREBUILT_DIR/derived-data" | ||
| cat > "$PREBUILT_DIR/metadata.txt" <<EOF | ||
| runtime_version=${IOS_RUNTIME_VERSION} | ||
| device_name=${IOS_DEVICE_NAME} | ||
| xcode_version=${{ steps.xcode.outputs.version }} | ||
| github_run_id=${GITHUB_RUN_ID} | ||
| github_sha=${GITHUB_SHA} | ||
| EOF | ||
| - name: Save prebuilt cache | ||
| if: steps.restore-prebuilt.outputs.cache-hit != 'true' | ||
| uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.3 | ||
| with: | ||
| path: ${{ env.PREBUILT_DIR }} | ||
| key: ios-runner-prebuilt-${{ steps.xcode.outputs.key }}-ios-${{ env.IOS_RUNTIME_VERSION }} | ||
| - name: Report prebuild cache status | ||
| run: | | ||
| set -euo pipefail | ||
| if [ "${{ steps.restore-prebuilt.outputs.cache-hit }}" = "true" ]; then | ||
| echo "Reused existing prebuild cache." | ||
| else | ||
| echo "Created/updated prebuild cache." | ||
| fi | ||