From 97e851be8f487a7b4f1a9806e63afe48d7d42764 Mon Sep 17 00:00:00 2001 From: Marc Schultz Date: Fri, 22 Mar 2024 17:07:39 +0100 Subject: [PATCH] Upload XCResults on test failures --- .github/workflows/ci.yml | 13 ++++++++++++- .gitignore | 1 + Makefile | 5 ++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7a152c7c..ad4fec34b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,18 @@ jobs: - name: Select Xcode ${{ matrix.xcode }} run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - name: Run tests - run: make test-swift + id: run-tests + run: make test-macos + - name: Zip XCResult + id: zip-xcresult + if: failure() && steps.run-tests.conclusion == 'failure' + run: cd .xcresults; zip -r xcresult-macos.zip macOS.xcresult + - name: Upload XCResult + if: failure() && steps.zip-xcresult.conclusion == 'success' + uses: actions/upload-artifact@v4 + with: + name: xcresult-macos.zip + path: .xcresults/xcresult-macos.zip ubuntu: strategy: diff --git a/.gitignore b/.gitignore index 54fcc576d..41bbbdcde 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ fastlane/screenshots fastlane/test_output .DS_Store +.xcresults/ diff --git a/Makefile b/Makefile index c28ea7f2c..487e89b1a 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,11 @@ test-linux: test-macos: set -o pipefail && \ xcodebuild test \ - -scheme SnapshotTesting \ + -scheme swift-snapshot-testing-Package \ -destination platform="macOS" \ + -resultBundlePath .xcresults/macos \ + -workspace . \ + | xcbeautify test-ios: set -o pipefail && \