-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
Copy pathfinal-jar-testing.yml
99 lines (87 loc) · 3.17 KB
/
final-jar-testing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
parameters:
- name: OS
displayName: Opserating System
type: string
- name: SpecificArtifact
displayName: Specific Artifact
type: string
default: ''
- name: BuildId
displayName: Build Id
type: string
default: ''
- name: PoolName
type: string
stages:
- stage: Final_Jar_Testing_${{parameters.OS}}
dependsOn:
Jar_Packaging
jobs:
- job: Final_Jar_Testing_${{parameters.OS}}
workspace:
clean: all
${{ if eq(parameters.OS, 'MacOS') }}:
pool:
name: 'Azure Pipelines'
image: macOS-14
os: macOS
${{ if eq(parameters.OS, 'Linux') }}:
pool:
name: ${{ parameters.PoolName }}
os: linux
${{ if eq(parameters.OS, 'Windows') }}:
pool:
name: ${{ parameters.PoolName }}
os: windows
variables:
- name: runCodesignValidationInjection
value: false
timeoutInMinutes: 60
steps:
- template: set-version-number-variables-step.yml
- template: flex-downloadPipelineArtifact.yml
parameters:
StepName: 'Download Final Jar'
ArtifactName: onnxruntime-java
TargetPath: '$(Build.BinariesDirectory)/final-jar'
SpecificArtifact: ${{ parameters.SpecificArtifact }}
BuildId: ${{ parameters.BuildId }}
- template: flex-downloadPipelineArtifact.yml
parameters:
StepName: 'Download Jar Tools'
ArtifactName: onnxruntime-java-tools
TargetPath: '$(Build.BinariesDirectory)/final-jar'
SpecificArtifact: ${{ parameters.SpecificArtifact }}
BuildId: ${{ parameters.BuildId }}
- ${{ if eq(parameters.OS, 'Windows') }}:
- task: CmdLine@2
inputs:
script: |
mkdir test
pushd test
jar xf $(Build.BinariesDirectory)\final-jar\testing.jar
popd
java -jar junit-platform-console-standalone-1.6.2.jar -cp .;.\test;protobuf-java-3.21.7.jar;onnxruntime-$(OnnxRuntimeVersion).jar --scan-class-path --fail-if-no-tests --disable-banner
workingDirectory: '$(Build.BinariesDirectory)\final-jar'
- ${{ else }}:
- task: Bash@3
inputs:
targetType: 'inline'
script: |
set -e -x
echo "Java Version"
java -version
mkdir test
pushd test
jar xf '$(Build.BinariesDirectory)/final-jar/testing.jar'
popd
# if you want to run the tests in the power shell, you need to replace ':' to ';', that is, "-cp .;.\test;protobuf-java-3.21.7.jar;onnxruntime-$(OnnxRuntimeVersion).jar"
java -jar ./junit-platform-console-standalone-1.6.2.jar -cp .:./test:./protobuf-java-3.21.7.jar:./onnxruntime-$(OnnxRuntimeVersion).jar --scan-class-path --fail-if-no-tests --disable-banner
workingDirectory: '$(Build.BinariesDirectory)/final-jar'
env:
${{ if eq(parameters.OS, 'MacOS') }}:
DYLD_LIBRARY_PATH: '$(Build.BinariesDirectory)/final-jar/test:$(DYLD_LIBRARY_PATH)'
${{ if eq(parameters.OS, 'Linux') }}:
LD_LIBRARY_PATH: '$(Build.BinariesDirectory)/final-jar/test:$(LD_LIBRARY_PATH)'
- ${{ if eq(parameters['OS'], 'MacOS') }}:
- template: use-xcode-version.yml