diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9904a5..580a710 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,26 +14,48 @@ jobs: runs-on: macos-26 steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - - name: Select Xcode 26.5 (stable) + - name: Select Xcode 26.4 id: xcode-stable - continue-on-error: true - uses: maxim-lobanov/setup-xcode@v1 + uses: maxim-lobanov/setup-xcode@v1.7.0 with: - xcode-version: "^26.5" + xcode-version: "^26.4" - - name: Select Xcode 26.5 (beta fallback) - if: steps.xcode-stable.outcome != 'success' - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: "^26.5-beta" + - name: Build & Test + env: + NSUnbufferedIO: YES + run: | + set -o pipefail + xcodebuild \ + -scheme AnalyticsKit \ + -destination "platform=iOS Simulator,name=iPhone 17 Pro" \ + clean build test 2>&1 | \ + tee build.log | \ + xcbeautify --renderer github-actions --report junit --report-path . --junit-report-filename test-results.xml - - name: Swift version - run: swift --version + - name: Print raw build log on failure + if: failure() + run: cat build.log 2>/dev/null || true - - name: Test + - name: Verify test results exist + if: (!cancelled()) run: | - xcodebuild test \ - -scheme AnalyticsKit \ - -destination "platform=iOS Simulator,name=iPhone 17 Pro" + if [ ! -f test-results.xml ]; then + echo "Error: test-results.xml was not generated" + exit 1 + fi + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v6.4.0 + if: (!cancelled()) + with: + report_paths: 'test-results.xml' + require_tests: true + fail_on_failure: true + fail_on_parse_error: true + comment: true + check_name: 'Test Results' + flaky_summary: true + updateComment: true +