Skip to content

Commit 31017cb

Browse files
committed
Test XCFramework
1 parent b6995f5 commit 31017cb

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

bitrise.yml

+28-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ workflows:
107107
# Define workspace and scheme
108108
WORKSPACE='Projects/XCFramework.xcworkspace'
109109
SCHEME='P256K'
110-
CONFIGURATION='Release'
110+
CONFIGURATION='Debug'
111111
ARCHIVE_DIR='Archives'
112112
113113
# Platforms to archive
@@ -132,7 +132,7 @@ 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" | xcbeautify
136136
137137
# Check if archive command was successful
138138
if [ $? -eq 0 ]; then
@@ -162,6 +162,32 @@ workflows:
162162
inputs:
163163
- deploy_path: "$BITRISE_SOURCE_DIR/P256K.xcframework"
164164
- is_compress: true
165+
- script:
166+
title: TEST XCFRAMEWORK
167+
timeout: 360
168+
inputs:
169+
- content: |-
170+
#!/usr/bin/env bash
171+
# fail if any commands fails; debug log
172+
set -ex
173+
174+
# Comment out the existing target for "P256K" in the Package.swift file.
175+
sed -i '' '/\.target(name: "P256K", dependencies: \["libsecp256k1"\]),/s/^/\/\//g' Package.swift
176+
177+
# Add the new target for "P256K" in the Package.swift file.
178+
sed -i '' '/\.target(name: "P256K", dependencies: \["libsecp256k1"\]),/a\
179+
.binaryTarget(\
180+
name: "P256K",\
181+
path: "./P256K.xcframework"\
182+
),\
183+
' Package.swift
184+
185+
# Update the dependency for the ZKPTests target to use the P256K binary target.
186+
sed -i '' 's/\.testTarget(name: "ZKPTests", dependencies: \["ZKP"\])/\.testTarget(name: "ZKPTests", dependencies: \["P256K"\])/' Package.swift
187+
188+
# Run swift tests after modifying the Package.swift, allowing verification
189+
# of the setup with the newly integrated XCFramework.
190+
swift test
165191
PULL-PACKAGE-FILES:
166192
steps:
167193
- pull-intermediate-files:

0 commit comments

Comments
 (0)