From c4e931193398a1c0ab0c8d406d5128f13d3d28a2 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 8 Feb 2026 19:49:49 +0800 Subject: [PATCH 1/2] Integrate xcbeautify into CI workflows Pipe xcodebuild and swift test output through xcbeautify with github-actions renderer for cleaner CI logs and inline annotations. --- .github/actions/uitests/action.yml | 11 +++++-- .github/workflows/compatibility_tests.yml | 40 +++++++++++++++-------- .github/workflows/ios.yml | 10 ++++-- .github/workflows/macos.yml | 10 ++++-- 4 files changed, 51 insertions(+), 20 deletions(-) diff --git a/.github/actions/uitests/action.yml b/.github/actions/uitests/action.yml index 9649db0ab..f975618d1 100644 --- a/.github/actions/uitests/action.yml +++ b/.github/actions/uitests/action.yml @@ -20,15 +20,21 @@ outputs: runs: using: composite steps: + - name: Install xcbeautify + shell: bash + run: brew install xcbeautify + - name: Record baseline images with SwiftUI shell: bash run: | cd Example + set -o pipefail xcodebuild test \ -scheme SUI_UITests \ -destination "${{ inputs.destination }}" \ -skipMacroValidation \ - -skipPackagePluginValidation || true + -skipPackagePluginValidation \ + | xcbeautify --renderer github-actions || true - name: Run UI tests with OpenSwiftUI id: uitest @@ -36,11 +42,12 @@ runs: shell: bash run: | cd Example + set -o pipefail xcodebuild test \ -scheme OSUI_UITests \ -destination "${{ inputs.destination }}" \ -skipMacroValidation \ - -skipPackagePluginValidation 2>&1 | tee /tmp/${{ inputs.platform }}-uitest.log + -skipPackagePluginValidation 2>&1 | tee /tmp/${{ inputs.platform }}-uitest.log | xcbeautify --renderer github-actions - name: Collect failed snapshots if: steps.uitest.outcome == 'failure' diff --git a/.github/workflows/compatibility_tests.yml b/.github/workflows/compatibility_tests.yml index a1616390f..5f9b397d0 100644 --- a/.github/workflows/compatibility_tests.yml +++ b/.github/workflows/compatibility_tests.yml @@ -34,18 +34,24 @@ jobs: - name: Set up build environment run: Scripts/CI/darwin_setup_build.sh shell: bash + - name: Install xcbeautify + run: brew install xcbeautify - name: Run compatibility tests on OpenSwiftUI + macOS run: | + set -o pipefail swift test \ --filter OpenSwiftUICompatibilityTests \ - --build-path .build-compatibility-test-debug + --build-path .build-compatibility-test-debug \ + | xcbeautify --renderer github-actions env: OPENSWIFTUI_COMPATIBILITY_TEST: 0 - name: Run compatibility tests on SwiftUI + macOS run: | + set -o pipefail swift test \ --filter OpenSwiftUICompatibilityTests \ - --build-path .build-compatibility-test-debug + --build-path .build-compatibility-test-debug \ + | xcbeautify --renderer github-actions env: OPENSWIFTUI_COMPATIBILITY_TEST: 1 compatibility_tests_ios: @@ -80,25 +86,31 @@ jobs: - name: Set up build environment run: Scripts/CI/darwin_setup_build.sh shell: bash + - name: Install xcbeautify + run: brew install xcbeautify - name: Run compatibility tests on OpenSwiftUI + iOS run: | + set -o pipefail xcodebuild test \ - -scheme OpenSwiftUI \ - -configuration Debug \ - -destination "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" \ - -only-testing:OpenSwiftUICompatibilityTests \ - -skipMacroValidation \ - -skipPackagePluginValidation + -scheme OpenSwiftUI \ + -configuration Debug \ + -destination "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" \ + -only-testing:OpenSwiftUICompatibilityTests \ + -skipMacroValidation \ + -skipPackagePluginValidation \ + | xcbeautify --renderer github-actions env: OPENSWIFTUI_COMPATIBILITY_TEST: 0 - name: Run compatibility tests on SwiftUI + iOS run: | + set -o pipefail xcodebuild test \ - -scheme OpenSwiftUI \ - -configuration Debug \ - -destination "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" \ - -only-testing:OpenSwiftUICompatibilityTests \ - -skipMacroValidation \ - -skipPackagePluginValidation + -scheme OpenSwiftUI \ + -configuration Debug \ + -destination "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" \ + -only-testing:OpenSwiftUICompatibilityTests \ + -skipMacroValidation \ + -skipPackagePluginValidation \ + | xcbeautify --renderer github-actions env: OPENSWIFTUI_COMPATIBILITY_TEST: 1 \ No newline at end of file diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index a1892b16c..d1f360c9d 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -40,19 +40,25 @@ jobs: - name: Set up build environment run: Scripts/CI/darwin_setup_build.sh shell: bash + - name: Install xcbeautify + run: brew install xcbeautify - name: Build test target in debug mode run: | + set -o pipefail xcodebuild build \ -scheme OpenSwiftUI \ -configuration Debug \ -destination "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" \ -skipMacroValidation \ - -skipPackagePluginValidation + -skipPackagePluginValidation \ + | xcbeautify --renderer github-actions - name: Run test target in debug mode run: | + set -o pipefail xcodebuild test \ -scheme OpenSwiftUI \ -configuration Debug \ -destination "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" \ -skipMacroValidation \ - -skipPackagePluginValidation + -skipPackagePluginValidation \ + | xcbeautify --renderer github-actions diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 45ddf6bfd..f6eb6f20b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -35,26 +35,32 @@ jobs: - name: Set up build environment run: Scripts/CI/darwin_setup_build.sh shell: bash + - name: Install xcbeautify + run: brew install xcbeautify - name: Build and run tests in debug mode with coverage run: | + set -o pipefail swift test \ -c debug \ --filter OpenSwiftUITests \ --filter OpenSwiftUICoreTests \ --enable-code-coverage \ - --build-path .build-test-debug + --build-path .build-test-debug \ + | xcbeautify --renderer github-actions xcrun llvm-cov show \ -instr-profile=.build-test-debug/debug/codecov/default.profdata \ .build-test-debug/debug/OpenSwiftUIPackageTests.xctest/Contents/MacOS/OpenSwiftUIPackageTests \ > coverage.txt - name: Build and run tests in release mode run: | + set -o pipefail swift test \ -c release \ --filter OpenSwiftUITests \ --filter OpenSwiftUICoreTests \ --enable-code-coverage \ - --build-path .build-test-release + --build-path .build-test-release \ + | xcbeautify --renderer github-actions - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} From c9d8c9c027f0b64884cfa84a240f505071863a1e Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 8 Feb 2026 19:59:57 +0800 Subject: [PATCH 2/2] Redirect stderr to stdout for swift test pipes SwiftPM emits compiler/test failures on stderr, so pipe both stdout and stderr through xcbeautify for proper formatting. --- .github/workflows/compatibility_tests.yml | 4 ++-- .github/workflows/macos.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/compatibility_tests.yml b/.github/workflows/compatibility_tests.yml index 5f9b397d0..fa44a92bf 100644 --- a/.github/workflows/compatibility_tests.yml +++ b/.github/workflows/compatibility_tests.yml @@ -42,7 +42,7 @@ jobs: swift test \ --filter OpenSwiftUICompatibilityTests \ --build-path .build-compatibility-test-debug \ - | xcbeautify --renderer github-actions + 2>&1 | xcbeautify --renderer github-actions env: OPENSWIFTUI_COMPATIBILITY_TEST: 0 - name: Run compatibility tests on SwiftUI + macOS @@ -51,7 +51,7 @@ jobs: swift test \ --filter OpenSwiftUICompatibilityTests \ --build-path .build-compatibility-test-debug \ - | xcbeautify --renderer github-actions + 2>&1 | xcbeautify --renderer github-actions env: OPENSWIFTUI_COMPATIBILITY_TEST: 1 compatibility_tests_ios: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f6eb6f20b..9445dc63b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -46,7 +46,7 @@ jobs: --filter OpenSwiftUICoreTests \ --enable-code-coverage \ --build-path .build-test-debug \ - | xcbeautify --renderer github-actions + 2>&1 | xcbeautify --renderer github-actions xcrun llvm-cov show \ -instr-profile=.build-test-debug/debug/codecov/default.profdata \ .build-test-debug/debug/OpenSwiftUIPackageTests.xctest/Contents/MacOS/OpenSwiftUIPackageTests \ @@ -60,7 +60,7 @@ jobs: --filter OpenSwiftUICoreTests \ --enable-code-coverage \ --build-path .build-test-release \ - | xcbeautify --renderer github-actions + 2>&1 | xcbeautify --renderer github-actions - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }}