diff --git a/.github/workflows/reusable-build-workflow.yml b/.github/workflows/reusable-build-workflow.yml index 4ff0558b..6fa12690 100644 --- a/.github/workflows/reusable-build-workflow.yml +++ b/.github/workflows/reusable-build-workflow.yml @@ -66,6 +66,12 @@ jobs: with: submodules: recursive + # dispatch simulator boot in bg coz it take a while to boot-up fresh + - name: Boot Simulator for testing + run: | + mkdir -p build/logs + make -B boot-sim-async | tee -a build/logs/test.log + - name: Install dependencies - ldid & xcbeautify & xcpretty run: | brew install ldid xcbeautify @@ -246,8 +252,12 @@ jobs: - name: Convert to IPA run: make ipa | tee -a build/logs/build.log - - name: Boot Simulator for testing - run: make -B boot-sim | tee -a build/logs/test.log + + # we expect simulator to have been booted by now, so exit otherwise + - name: Simulator Boot Check + run: | + mkdir -p build/logs + make -B sim-boot-check | tee -a build/logs/test.log - name: Start Recording UI tests (if DEBUG_RECORD_TESTS is set to 1) if: ${{ vars.DEBUG_RECORD_TESTS == '1' }} @@ -261,7 +271,7 @@ jobs: # using 'tee' to intercept stdout and log for detailed build-log run: | NSUnbufferedIO=YES make -B build-and-test 2>&1 | tee -a build/logs/test.log | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} - # NSUnbufferedIO=YES make boot-sim build-and-test 2>&1 | tee build/logs/test.log | xcpretty -r junit --output ./build/tests/test-results.xml && exit ${PIPESTATUS[0]} + # NSUnbufferedIO=YES make -B build-and-test 2>&1 | tee build/logs/test.log | xcpretty -r junit --output ./build/tests/test-results.xml && exit ${PIPESTATUS[0]} - name: Stop Recording tests if: ${{ always() && env.RECORD_PID != '' }} diff --git a/Makefile b/Makefile index 192bfcc1..5a523e76 100755 --- a/Makefile +++ b/Makefile @@ -208,19 +208,23 @@ build-and-test: # code cov probably cause full recompilation of tests even if archive target was just invoked before tests # -enableCodeCoverage YES \ -boot-sim: +boot-sim-async: @if xcrun simctl list devices "iPhone 16 Pro" | grep -q "Booted"; then \ echo "Simulator 'iPhone 16 Pro' is already booted."; \ else \ - echo "Booting simulator 'iPhone 16 Pro'..."; \ - xcrun simctl boot "iPhone 16 Pro"; \ - \ - if xcrun simctl list devices "iPhone 16 Pro" | grep -q "Booted"; then \ - echo "Simulator 'iPhone 16 Pro' is now booted."; \ - else \ - echo "Simulator bootup failed..."; \ - exit 1; \ - fi \ + echo "Booting simulator 'iPhone 16 Pro' asynchronously..."; \ + # Dispatch boot in the background + xcrun simctl boot "iPhone 16 Pro" & \ + echo "Simulator boot command dispatched."; \ + fi + +sim-boot-check: + @echo "Checking simulator boot status..." + @if xcrun simctl list devices "iPhone 16 Pro" | grep -q "Booted"; then \ + echo "Simulator 'iPhone 16 Pro' is booted."; \ + else \ + echo "Simulator bootup failed or is not booted yet."; \ + exit 1; \ fi clean-build: