Skip to content

Commit

Permalink
Upload XCResults on test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
lunij committed Mar 22, 2024
1 parent 8d805b2 commit 97e851b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ fastlane/screenshots
fastlane/test_output

.DS_Store
.xcresults/
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down

0 comments on commit 97e851b

Please sign in to comment.