From 3d7d8fbffd30c32484836db1712abe01a27dfe55 Mon Sep 17 00:00:00 2001 From: rachguo Date: Thu, 13 Jul 2023 13:38:55 -0700 Subject: [PATCH] fix --- .../mac-ios-swift-packaging-pipeline.yml | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/tools/ci_build/github/mac-ios-swift-packaging-pipeline.yml b/tools/ci_build/github/mac-ios-swift-packaging-pipeline.yml index 94b72a4..45c739b 100644 --- a/tools/ci_build/github/mac-ios-swift-packaging-pipeline.yml +++ b/tools/ci_build/github/mac-ios-swift-packaging-pipeline.yml @@ -165,12 +165,21 @@ jobs: workingDirectory: '$(Build.ArtifactStagingDirectory)/ios_packaging_artifacts_full' displayName: "List staged artifacts" - - script: | + - bash: | set -e -x ARTIFACTS_LIST=$(ls) POD_ARCHIVE=$(echo "${ARTIFACTS_LIST}" | sed -n '3p') - echo "##vso[task.setvariable variable=podArchiveName]${POD_ARCHIVE}" - shasum -a 256 "$(podArchiveName)" + + set_var() { + local VAR_NAME=${1:?} + local VAR_VALUE=${2:?} + echo "##vso[task.setvariable variable=${VAR_NAME}]${VAR_VALUE}" + echo "${VAR_NAME}: ${VAR_VALUE}" + } + + set_var "POD_ARCHIVE_NAME" ${POD_ARCHIVE}" + + shasum -a 256 "${POD_ARCHIVE_NAME}" workingDirectory: '$(Build.ArtifactStagingDirectory)/ios_packaging_artifacts_full' displayName: "Print ORT iOS Pod checksum" @@ -178,14 +187,14 @@ jobs: # copy the pod archive to a path relative to Package.swift and set the env var required by Package.swift to use that. # xcodebuild will implicitly use Package.swift and build/run the .testTarget (tests in swift/onnxTests). # once that's done cleanup the copy of the pod zip file - # - script: | - # set -e -x - # cp "$(Build.ArtifactStagingDirectory)/ios_packaging_artifacts_full/" swift/ - # export ORT_IOS_POD_LOCAL_PATH="swift/${{ variables.podArchiveName }}" - # xcodebuild test -scheme onnxruntime -destination 'platform=iOS Simulator,name=iPhone 14' - # rm swift/pod-archive-onnxruntime-c-*.zip - # workingDirectory: $(Build.SourcesDirectory) - # displayName: "Test Package.swift usage" + - script: | + set -e -x + cp "$(Build.ArtifactStagingDirectory)/ios_packaging_artifacts_full/${POD_ARCHIVE_NAME}" swift/ + export ORT_IOS_POD_LOCAL_PATH="swift/${POD_ARCHIVE_NAME}" + xcodebuild test -scheme onnxruntime -destination 'platform=iOS Simulator,name=iPhone 14' + rm swift/pod-archive-onnxruntime-c-*.zip + workingDirectory: $(Build.SourcesDirectory) + displayName: "Test Package.swift usage" # - publish: "$(Build.ArtifactStagingDirectory)" # artifact: ios_packaging_artifacts