-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
106 lines (101 loc) · 3.61 KB
/
azure-pipelines.yml
File metadata and controls
106 lines (101 loc) · 3.61 KB
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
97
98
99
100
101
102
103
104
105
106
trigger:
branches:
include:
- main
pr:
branches:
include:
- main
exclude:
- docs/*
- images/*
- '*.md'
- '*.txt'
pool:
name: Default
demands: LabVIEW
variables:
libssh2.version: '1.11.1'
libssh2.commit: 'a312b43325e3383c865a87bb1d26cb52e3292641'
openssl.version: '3.6.2'
openssl.commit: 'fe686e15d84334b284f883118ed92f64b409b3aa'
DLL_CACHE_FOLDER: '$(System.DefaultWorkingDirectory)/Cache'
strategy:
matrix:
'x86-win-openssl-debug':
architecture: 'Win32'
backend: 'OpenSSL'
config: 'Debug'
'x86-win-openssl-release':
architecture: 'Win32'
backend: 'OpenSSL'
config: 'Release'
steps:
- task: Cache@2
displayName: 'Cache built DLLs'
inputs:
key: '"dlls" | "$(architecture)" | "$(backend)" | "$(config)" | "$(libssh2.commit)" | "$(openssl.commit)"'
path: '$(DLL_CACHE_FOLDER)'
cacheHitVar: CACHE_RESTORED
- task: CmdLine@2
displayName: 'Restore cache files'
condition: eq(variables.CACHE_RESTORED, 'true')
inputs:
script: |
if not exist "$(DLL_CACHE_FOLDER)\*.dll" (
echo "No cached DLLs found."
) else (
echo "Restoring cached DLLs..."
xcopy "$(DLL_CACHE_FOLDER)\*.dll" "$(Build.SourcesDirectory)\libssh2\" /Y /I
)
workingDirectory: '$(Build.SourcesDirectory)'
- task: CmdLine@2
displayName: 'Prepare build configurations'
condition: ne(variables.CACHE_RESTORED, 'true')
inputs:
script: cmake -B build/$(architecture) -S . -G "Visual Studio 17 2022" -A $(architecture) -DLIBSSH2_SOURCE=GitHub -DLIBSSH2_COMMIT_HASH=$(libssh2.commit) -DCRYPTO_BACKEND=$(backend) -DOPENSSL_COMMIT_HASH=$(openssl.commit)
workingDirectory: '$(Build.SourcesDirectory)'
- task: CmdLine@2
displayName: 'Build libraries'
condition: ne(variables.CACHE_RESTORED, 'true')
inputs:
script: cmake --build build/$(architecture) --config $(config)
workingDirectory: '$(Build.SourcesDirectory)'
- script: docker compose up -d --force-recreate
displayName: 'Start SSH server'
workingDirectory: '$(Build.SourcesDirectory)/docker'
- task: CmdLine@2
displayName: 'Restore packages'
inputs:
script: 'LabVIEWCLI -LabVIEWPath "%LabVIEW%\LabVIEW.exe" -AdditionalOperationDirectory "$(Build.SourcesDirectory)\Toolchain" -OperationName Restore -Configuration "$(Build.SourcesDirectory)\lvssh2-dev.vipc"'
workingDirectory: '$(Build.SourcesDirectory)'
- task: CmdLine@2
displayName: 'Run tests'
inputs:
script: 'LabVIEWCLI -LabVIEWPath "%LabVIEW%\LabVIEW.exe" -AdditionalOperationDirectory "$(Build.SourcesDirectory)\Toolchain" -OperationName Test -Project "$(Build.SourcesDirectory)\lvssh2.lvproj" -ResultsFolder "$(System.DefaultWorkingDirectory)\TestResults"'
workingDirectory: '$(Build.SourcesDirectory)'
- script: docker compose down
displayName: 'Stop SSH server'
workingDirectory: '$(Build.SourcesDirectory)/docker'
- publish: '$(System.DefaultWorkingDirectory)/docker/openssh-server/config/logs/openssh/current'
displayName: 'Publish SSH server logs'
artifact: server-log-($(Agent.JobName))
- task: PublishTestResults@2
displayName: 'Publish test results'
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-*.xml'
failTaskOnFailedTests: true
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: '**/COVERAGE-*.xml'
pathToSources: '$(System.DefaultWorkingDirectory)/src'
failIfCoverageEmpty: true
- task: CmdLine@2
displayName: 'Prepare cache files'
inputs:
script: |
if not exist "$(DLL_CACHE_FOLDER)" (
mkdir "$(DLL_CACHE_FOLDER)"
)
xcopy "$(Build.SourcesDirectory)\libssh2\*.dll" "$(DLL_CACHE_FOLDER)\" /Y /I