From e5713fa3a999428f8dadbd759de76f71c5c99cfc Mon Sep 17 00:00:00 2001 From: Magesh K <47920326+mahee96@users.noreply.github.com> Date: Sat, 22 Feb 2025 18:35:49 +0530 Subject: [PATCH] - CI: Fixes to make build re-useable --- .github/workflows/reusable-build-workflow.yml | 2 +- Makefile | 31 ++++++++++--------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/reusable-build-workflow.yml b/.github/workflows/reusable-build-workflow.yml index 74fa6cb0..4ff0558b 100644 --- a/.github/workflows/reusable-build-workflow.yml +++ b/.github/workflows/reusable-build-workflow.yml @@ -252,7 +252,7 @@ jobs: - name: Start Recording UI tests (if DEBUG_RECORD_TESTS is set to 1) if: ${{ vars.DEBUG_RECORD_TESTS == '1' }} run: | - nohup xcrun simctl io booted recordVideo test-recording.mp4 test-recording.log 2>&1 & + nohup xcrun simctl io booted recordVideo -f test-recording.mp4 --codec h264 test-recording.log 2>&1 & RECORD_PID=$! echo "RECORD_PID=$RECORD_PID" >> $GITHUB_ENV diff --git a/Makefile b/Makefile index 7a20d0ea..192bfcc1 100755 --- a/Makefile +++ b/Makefile @@ -169,6 +169,8 @@ MARKETING_VERSION ?= BUNDLE_ID_SUFFIX ?= # Common build settings for xcodebuild COMMON_BUILD_SETTINGS = \ + -workspace AltStore.xcworkspace \ + -scheme SideStore \ -sdk iphoneos \ -configuration $(BUILD_CONFIG) \ CODE_SIGNING_REQUIRED=NO \ @@ -190,11 +192,22 @@ endif build: @echo ">>>>>>>>> BUILD_CONFIG is set to '$(BUILD_CONFIG)', Building for $(BUILD_CONFIG) mode! <<<<<<<<<<" @echo "" - @xcodebuild -workspace AltStore.xcworkspace \ - -scheme SideStore \ - archive -archivePath ./SideStore \ + @xcodebuild archive -archivePath ./SideStore \ $(COMMON_BUILD_SETTINGS) +build-and-test: + @rm -rf build/tests/test-results.xcresult + @echo ">>>>>>>>> BUILD_CONFIG is set to '$(BUILD_CONFIG)', Building for $(BUILD_CONFIG) mode! <<<<<<<<<<" + @echo "" + @echo "Performing a build and running tests..." + @xcodebuild test \ + -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.2' \ + -resultBundlePath build/tests/test-results.xcresult \ + $(COMMON_BUILD_SETTINGS) + + # code cov probably cause full recompilation of tests even if archive target was just invoked before tests + # -enableCodeCoverage YES \ + boot-sim: @if xcrun simctl list devices "iPhone 16 Pro" | grep -q "Booted"; then \ echo "Simulator 'iPhone 16 Pro' is already booted."; \ @@ -210,18 +223,6 @@ boot-sim: fi \ fi -build-and-test: - @rm -rf build/tests/test-results.xcresult - @echo ">>>>>>>>> BUILD_CONFIG is set to '$(BUILD_CONFIG)', Building for $(BUILD_CONFIG) mode! <<<<<<<<<<" - @echo "" - @echo "Performing a build and running tests..." - @xcodebuild test -workspace AltStore.xcworkspace \ - -scheme SideStore \ - -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.2' \ - -enableCodeCoverage YES \ - -resultBundlePath build/tests/test-results.xcresult \ - $(COMMON_BUILD_SETTINGS) - clean-build: @echo "Cleaning build artifacts..." @xcodebuild clean -workspace AltStore.xcworkspace -scheme SideStore