Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/swift-build-and-test-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ jobs:
test-path: ./Scripts/build_and_test_samples
job-name: Build & Test Sample Apps
setup-storefront-env: true
artifact-name: swift-sample-builds-xcresult
1 change: 1 addition & 0 deletions .github/workflows/swift-test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ jobs:
with:
test-path: ./Scripts/xcode_run test ShopifyCheckoutKit-Package
job-name: Run Package Tests
artifact-name: swift-package-tests-xcresult
13 changes: 13 additions & 0 deletions .github/workflows/swift-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
required: false
type: string
default: Run
artifact-name:
required: true
type: string
setup-storefront-env:
required: false
type: boolean
Expand Down Expand Up @@ -84,3 +87,13 @@ jobs:

- name: Run Tests
run: ${{ inputs.test-path }}

- name: Upload xcresult bundle
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ inputs.artifact-name }}
path: .xcresults/
if-no-files-found: warn
include-hidden-files: true
retention-days: 7
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ node_modules/
# Swift / Xcode / SwiftPM
.build/
.swiftpm/
.xcresults/
xcuserdata/
platforms/swift/Samples/**/*.xcodeproj/
platforms/react-native/test/rct-integration-app/*.xcodeproj/
Expand Down
8 changes: 8 additions & 0 deletions platforms/swift/Scripts/xcode_run
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ if [[ "$SCHEME" == "ShopifyCheckoutKit-Package" && "$ACTION" == *"build"* && "$A
xcodebuild_cmd="$xcodebuild_cmd SWIFT_TREAT_WARNINGS_AS_ERRORS=YES"
fi

if [[ "$CI" == "true" && ( "$ACTION" == *"build"* || "$ACTION" == *"test"* ) ]]; then
result_bundle_dir="$(cd "$SCRIPT_DIR/../../.." && pwd)/.xcresults"
result_bundle_path="$result_bundle_dir/$SCHEME.xcresult"
rm -rf "$result_bundle_path"
mkdir -p "$result_bundle_dir"
xcodebuild_cmd="$xcodebuild_cmd -resultBundlePath \"$result_bundle_path\""
fi

# Package.swift lives at the monorepo root. For SwiftPM package schemes
# (Xcode's auto-generated "-Package" suffix), cd up to the directory that
# contains it before invoking xcodebuild — xcodebuild discovers SwiftPM
Expand Down
Loading