- CI: Fixes to make build re-useable

This commit is contained in:
Magesh K
2025-02-22 18:35:49 +05:30
parent 35e3cf1e14
commit e5713fa3a9
2 changed files with 17 additions and 16 deletions

View File

@@ -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 </dev/null > test-recording.log 2>&1 &
nohup xcrun simctl io booted recordVideo -f test-recording.mp4 --codec h264 </dev/null > test-recording.log 2>&1 &
RECORD_PID=$!
echo "RECORD_PID=$RECORD_PID" >> $GITHUB_ENV

View File

@@ -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