Skip to content
Merged
7 changes: 7 additions & 0 deletions .github/actions/boot-simulator/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/test-bwa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down