diff --git a/.github/actions/boot-simulator/action.yml b/.github/actions/boot-simulator/action.yml index bec14eaca9..75a9083e7b 100644 --- a/.github/actions/boot-simulator/action.yml +++ b/.github/actions/boot-simulator/action.yml @@ -10,10 +10,16 @@ inputs: description: 'iOS version for the simulator (e.g., 26.0)' required: true +outputs: + simulator-id: + description: 'The identifier of the booted simulator device' + value: ${{ steps.boot.outputs.device-id }} + runs: using: 'composite' steps: - name: Boot Simulator + id: boot shell: bash env: _SIMULATOR_NAME: ${{ inputs.simulator-name }} @@ -29,6 +35,7 @@ runs: xcrun simctl runtime dyld_shared_cache update --all echo "--------------------------------" echo "👀 Booting simulator: $_SIMULATOR_NAME ($_SIMULATOR_VERSION) with ID: $DEVICE_ID" + echo "device-id=$DEVICE_ID" >> "$GITHUB_OUTPUT" i=1 max=5 diff --git a/.github/workflows/test-bwa.yml b/.github/workflows/test-bwa.yml index 28eb4b5f68..2858eb5df9 100644 --- a/.github/workflows/test-bwa.yml +++ b/.github/workflows/test-bwa.yml @@ -128,38 +128,41 @@ jobs: ./Scripts/bootstrap.sh - name: Boot Simulator + id: boot-simulator uses: ./.github/actions/boot-simulator with: simulator-name: ${{ env._SIMULATOR_NAME }} simulator-version: ${{ env._SIMULATOR_VERSION }} - name: Build + env: + _SIMULATOR_ID: ${{ steps.boot-simulator.outputs.simulator-id }} run: | python Scripts/pyeetd/main.py & PYEETD_PID=$! xcrun xcodebuild build-for-testing \ -workspace Bitwarden.xcworkspace \ -scheme Authenticator \ -configuration Debug \ - -destination "platform=iOS Simulator,name=$_SIMULATOR_NAME,OS=$_SIMULATOR_VERSION" \ + -destination "platform=iOS Simulator,id=$_SIMULATOR_ID" \ -derivedDataPath build/DerivedData \ -resultBundlePath "$_BUILD_RESULT_BUNDLE_PATH" \ -quiet kill "$PYEETD_PID" - name: Test + env: + _SIMULATOR_ID: ${{ steps.boot-simulator.outputs.simulator-id }} run: | python Scripts/pyeetd/main.py & PYEETD_PID=$! xcrun xcodebuild test-without-building \ -workspace Bitwarden.xcworkspace \ -scheme Authenticator \ -configuration Debug \ - -destination "platform=iOS Simulator,name=$_SIMULATOR_NAME,OS=$_SIMULATOR_VERSION" \ + -destination "platform=iOS Simulator,id=$_SIMULATOR_ID" \ -resultBundlePath "$_TESTS_RESULT_BUNDLE_PATH" \ -derivedDataPath build/DerivedData \ -test-timeouts-enabled yes \ -maximum-test-execution-time-allowance 1 \ - -retry-tests-on-failure \ - -test-repetition-relaunch-enabled YES \ -quiet kill "$PYEETD_PID" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e19f6e4ce4..b5131a30f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -123,40 +123,43 @@ jobs: ./Scripts/bootstrap.sh - name: Boot Simulator + id: boot-simulator uses: ./.github/actions/boot-simulator with: simulator-name: ${{ env._SIMULATOR_NAME }} simulator-version: ${{ env._SIMULATOR_VERSION }} - name: Build + env: + _SIMULATOR_ID: ${{ steps.boot-simulator.outputs.simulator-id }} run: | python Scripts/pyeetd/main.py & PYEETD_PID=$! xcrun xcodebuild build-for-testing \ -workspace Bitwarden.xcworkspace \ -scheme Bitwarden \ -configuration Debug \ - -destination "platform=iOS Simulator,name=$_SIMULATOR_NAME,OS=$_SIMULATOR_VERSION" \ + -destination "platform=iOS Simulator,id=$_SIMULATOR_ID" \ -derivedDataPath build/DerivedData \ -resultBundlePath "$_BUILD_RESULT_BUNDLE_PATH" \ -quiet kill "$PYEETD_PID" - name: Test + env: + _SIMULATOR_ID: ${{ steps.boot-simulator.outputs.simulator-id }} run: | python Scripts/pyeetd/main.py & PYEETD_PID=$! xcrun xcodebuild test-without-building \ -workspace Bitwarden.xcworkspace \ -scheme Bitwarden \ -configuration Debug \ - -destination "platform=iOS Simulator,name=$_SIMULATOR_NAME,OS=$_SIMULATOR_VERSION" \ - -resultBundlePath $_TESTS_RESULT_BUNDLE_PATH \ + -destination "platform=iOS Simulator,id=$_SIMULATOR_ID" \ + -resultBundlePath "$_TESTS_RESULT_BUNDLE_PATH" \ -derivedDataPath build/DerivedData \ -test-timeouts-enabled yes \ -maximum-test-execution-time-allowance 1 \ - -retry-tests-on-failure \ - -test-repetition-relaunch-enabled YES \ -quiet - kill $PYEETD_PID + kill "$PYEETD_PID" - name: Print Logs Summary if: always()