From 5323fdadcf4c233e5d9924fe5d183c5663266dff Mon Sep 17 00:00:00 2001 From: Magesh K <47920326+mahee96@users.noreply.github.com> Date: Sat, 22 Feb 2025 02:37:30 +0530 Subject: [PATCH] - CI: Included tests for CI builds --- .github/workflows/reusable-build-workflow.yml | 21 ++++++++++++++++--- .gitignore | 6 +++++- Makefile | 1 + 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-build-workflow.yml b/.github/workflows/reusable-build-workflow.yml index 7e51fef3..6fcfaf0a 100644 --- a/.github/workflows/reusable-build-workflow.yml +++ b/.github/workflows/reusable-build-workflow.yml @@ -66,8 +66,10 @@ jobs: with: submodules: recursive - - name: Install dependencies - ldid & xcbeautify - run: brew install ldid xcbeautify + - name: Install dependencies - ldid & xcbeautify & xcpretty + run: | + brew install ldid xcbeautify + gem install xcpretty # for test reports - name: Set ref based on is_shared_build_num if: ${{ inputs.is_beta }} @@ -226,10 +228,17 @@ jobs: run: | echo "BUNDLE_ID_SUFFIX=${{ inputs.bundle_id_suffix }}" >> $GITHUB_ENV - - name: Build SideStore + - name: Build and run SideStore Tests + # using 'tee' to intercept stdout and log for detailed build-log + run: | + NSUnbufferedIO=YES make boot-sim build-and-test 2>&1 | tee build.log | xcpretty -r junit --output ./build/tests/test-results.xml && exit ${PIPESTATUS[0]} + echo "--------------------------------------------------------------------" >> build.log + + - name: Build SideStore archive # using 'tee' to intercept stdout and log for detailed build-log run: | NSUnbufferedIO=YES make build 2>&1 | tee build.log | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} + echo "--------------------------------------------------------------------" >> build.log - name: Fakesign app run: make fakesign | tee -a build.log @@ -329,6 +338,12 @@ jobs: name: SideStore-${{ steps.version.outputs.version }}-dSYM path: ./SideStore.xcarchive/dSYMs/* + - name: Upload Test Artifact + uses: actions/upload-artifact@v4 + with: + name: test-results-${{ steps.version.outputs.version }}.zip + path: ./build/tests/* + - name: Upload encrypted-build_log.zip uses: actions/upload-artifact@v4 with: diff --git a/.gitignore b/.gitignore index d7f580cd..0d7ee15c 100644 --- a/.gitignore +++ b/.gitignore @@ -63,4 +63,8 @@ SideStore/.skip-prebuilt-fetch-em_proxy # Never check-in this package.resolved file # coz SPM then resolves packages using the stale entries in this file *.xcodeproj/**/Package.resolved -*.xcworkspace/**/Package.resolved \ No newline at end of file +*.xcworkspace/**/Package.resolved + +# build/test artifacts +build.log +report.html diff --git a/Makefile b/Makefile index c847ba7b..2bbf3f72 100755 --- a/Makefile +++ b/Makefile @@ -211,6 +211,7 @@ build-and-test: -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: