Skip to content

Commit 720e824

Browse files
committed
Test XCFramework
1 parent b6995f5 commit 720e824

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

bitrise.yml

+28-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ workflows:
132132
-scheme "$SCHEME" \
133133
-configuration "$CONFIGURATION" \
134134
-destination "generic/platform=$PLATFORM" \
135-
-archivePath "$ARCHIVE_DIR/P256K-$PLATFORM.xcarchive" | xcbeautify
135+
-archivePath "$ARCHIVE_DIR/P256K-$PLATFORM.xcarchive" \
136+
ENABLE_TESTABILITY=YES | xcbeautify
136137
137138
# Check if archive command was successful
138139
if [ $? -eq 0 ]; then
@@ -162,6 +163,32 @@ workflows:
162163
inputs:
163164
- deploy_path: "$BITRISE_SOURCE_DIR/P256K.xcframework"
164165
- is_compress: true
166+
- script:
167+
title: TEST XCFRAMEWORK
168+
timeout: 360
169+
inputs:
170+
- content: |-
171+
#!/usr/bin/env bash
172+
# fail if any commands fails; debug log
173+
set -ex
174+
175+
# Comment out the existing target for "P256K" in the Package.swift file.
176+
sed -i '' '/\.target(name: "P256K", dependencies: \["libsecp256k1"\]),/s/^/\/\//g' Package.swift
177+
178+
# Add the new target for "P256K" in the Package.swift file.
179+
sed -i '' '/\.target(name: "P256K", dependencies: \["libsecp256k1"\]),/a\
180+
.binaryTarget(\
181+
name: "P256K",\
182+
path: "./P256K.xcframework"\
183+
),\
184+
' Package.swift
185+
186+
# Update the dependency for the ZKPTests target to use the P256K binary target.
187+
sed -i '' 's/\.testTarget(name: "ZKPTests", dependencies: \["ZKP"\])/\.testTarget(name: "ZKPTests", dependencies: \["P256K"\])/' Package.swift
188+
189+
# Run swift tests after modifying the Package.swift, allowing verification
190+
# of the setup with the newly integrated XCFramework.
191+
swift test
165192
PULL-PACKAGE-FILES:
166193
steps:
167194
- pull-intermediate-files:

0 commit comments

Comments
 (0)