4444 MINT_LINK_PATH : .mint/bin # used by mint in bootstrap.sh
4545 MINT_PATH : .mint/lib # used by mint in bootstrap.sh
4646 _COVERAGE_PATH : build/coverage.xml
47- _RESULT_BUNDLE_PATH : build/BitwardenTests.xcresult
47+ _BUILD_RESULT_BUNDLE_PATH : build/bwpm-build.xcresult
48+ _TESTS_RESULT_BUNDLE_PATH : build/bwpm-tests.xcresult
4849 _SIMULATOR_NAME : ${{ inputs.simulator-name }}
4950 _SIMULATOR_VERSION : ${{ inputs.simulator-version }}
5051 _XCODE_VERSION : ${{ inputs.xcode-version }}
@@ -119,43 +120,59 @@ jobs:
119120 brew bundle
120121 ./Scripts/bootstrap.sh
121122
122- - name : Build and test
123+ - name : Boot Simulator
124+ run : |
125+ echo "Listing simulator devices:"
126+ SIMULATORS=$(xcrun simctl list devices "iOS $_SIMULATOR_VERSION" available)
127+ echo "$SIMULATORS"
128+ DEVICE_ID=$(echo "$SIMULATORS" | grep "$_SIMULATOR_NAME" | head -1 | sed -E 's/.*\(([A-F0-9-]+)\).*/\1/')
129+ echo "--------------------------------"
130+ echo "Booting simulator: $_SIMULATOR_NAME ($_SIMULATOR_VERSION) with ID: $DEVICE_ID"
131+ xcrun simctl boot "$DEVICE_ID"
132+ xcrun simctl bootstatus "$DEVICE_ID"
133+
134+ - name : Build
123135 run : |
124136 python Scripts/pyeetd/main.py & PYEETD_PID=$!
125- xcrun xcodebuild test \
126- -workspace Bitwarden.xcworkspace \
127- -scheme Bitwarden \
128- -configuration Debug \
129- -destination "platform=iOS Simulator,name=$_SIMULATOR_NAME,OS=$_SIMULATOR_VERSION" \
130- -resultBundlePath $_RESULT_BUNDLE_PATH \
131- -derivedDataPath build/DerivedData \
132- -test-timeouts-enabled yes \
133- -maximum-test-execution-time-allowance 1 \
134- -retry-tests-on-failure \
135- -test-repetition-relaunch-enabled YES \
136- -quiet
137+ xcrun xcodebuild build-for-testing \
138+ -workspace Bitwarden.xcworkspace \
139+ -scheme Bitwarden \
140+ -configuration Debug \
141+ -destination "platform=iOS Simulator,name=$_SIMULATOR_NAME,OS=$_SIMULATOR_VERSION" \
142+ -derivedDataPath build/DerivedData \
143+ -resultBundlePath $_BUILD_RESULT_BUNDLE_PATH \
144+ -quiet
137145 kill $PYEETD_PID
138146
139- - name : Output processes
147+ - name : Test
140148 run : |
141- echo "Sorted by memory usage"
142- ps -em -o pid,pcpu,pmem,comm | head -n40
143- echo "--------------------------------"
144- echo "Sorted by CPU usage"
145- ps -er -o pid,pcpu,pmem,comm | head -n40
149+ python Scripts/pyeetd/main.py & PYEETD_PID=$!
150+ xcrun xcodebuild test-without-building \
151+ -workspace Bitwarden.xcworkspace \
152+ -scheme Bitwarden \
153+ -configuration Debug \
154+ -destination "platform=iOS Simulator,name=$_SIMULATOR_NAME,OS=$_SIMULATOR_VERSION" \
155+ -resultBundlePath $_TESTS_RESULT_BUNDLE_PATH \
156+ -derivedDataPath build/DerivedData \
157+ -test-timeouts-enabled yes \
158+ -maximum-test-execution-time-allowance 1 \
159+ -retry-tests-on-failure \
160+ -test-repetition-relaunch-enabled YES \
161+ -quiet
162+ kill $PYEETD_PID
146163
147164 - name : Print Logs Summary
148165 if : always()
149166 run : |
150- xcresultparser -o cli "$_RESULT_BUNDLE_PATH "
167+ xcresultparser -o cli "$_TESTS_RESULT_BUNDLE_PATH "
151168 echo "# Test Summary" >> $GITHUB_STEP_SUMMARY
152- xcresultparser -f -o txt "$_RESULT_BUNDLE_PATH " | grep "Number of" >> $GITHUB_STEP_SUMMARY
169+ xcresultparser -f -o txt "$_TESTS_RESULT_BUNDLE_PATH " | grep "Number of" >> $GITHUB_STEP_SUMMARY
153170
154171 - name : Convert coverage to Cobertura
155172 run : |
156173 set -o pipefail && \
157174 xcresultparser --output-format cobertura \
158- "$_RESULT_BUNDLE_PATH " > "$_COVERAGE_PATH"
175+ "$_TESTS_RESULT_BUNDLE_PATH " > "$_COVERAGE_PATH"
159176
160177 - name : Upload test reports
161178 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
@@ -165,7 +182,8 @@ jobs:
165182 compression-level : 9
166183 path : |
167184 ${{ env._COVERAGE_PATH }}
168- ${{ env._RESULT_BUNDLE_PATH }}
185+ ${{ env._TESTS_RESULT_BUNDLE_PATH }}
186+ ${{ env._BUILD_RESULT_BUNDLE_PATH }}
169187
170188 report :
171189 name : Process Test Reports
0 commit comments