forked from ni/nilrt-snac
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipeline.yaml
More file actions
128 lines (114 loc) · 4.87 KB
/
azure-pipeline.yaml
File metadata and controls
128 lines (114 loc) · 4.87 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Run sanity checks for nilrt-snac PRs
resources:
repositories:
- repository: DevCentral/ni-central
type: git
name: ni-central
- repository: Tools
type: git
name: DevCentral/Tools
# Use an old version of setup-venv.yml
ref: 1034f8129f933c91c24abbd737e429590e3f23ff
parameters:
- name: rtos_oetest_locked_pr_build
displayName: 'rtos-oetest-locked PR build number (default: empty)'
type: string
default: ' '
variables:
- name: BRANCH_NAME
value: $[replace(variables['Build.SourceBranch'], 'refs/heads/', '')]
- name: ParamsOutputFile
value: $(Build.SourcesDirectory)\snac_pr_params.yaml
- name: CompiledMobilizePlan
value: $(Agent.TempDirectory)/compile_mobilize_plan.yaml
- template: /src/rtos/pipeline/version.yml@DevCentral/ni-central
pr:
paths:
exclude:
- .github/*
- .vs/*
branches:
include:
- master
pool:
name: Drivers-NIBuildFarm-RFMIBUILD
demands:
- agent.os -equals Windows_NT
- python3
# Only allow one instance of this pipeline to run at a time to avoid resource contention issues with the targets used in testing.
lockBehavior: sequential
jobs:
- job: SanityTests
continueOnError: false
steps:
- powershell: |
if ("$(Build.Reason)" -eq "Manual") {
Write-Host "The pipeline was triggered manually."
} elseif ("$(Build.Reason)" -eq "PullRequest") {
Write-Host "The pipeline was triggered by a pull request."
} else {
Write-Host "The pipeline was triggered by another reason: $(Build.Reason)"
}
displayName: CheckTriggerReason
- powershell: |
echo "Hello, world!"
echo "Build number: $(Build.BuildNumber)"
echo "Build ID: $(Build.BuildID)"
echo "Build Reason: $(Build.Reason)"
echo "Build Sources Directory: $(Build.SourcesDirectory)"
echo "Build SourceBranch: $(BRANCH_NAME)"
echo "REPO_EXTERNAL_VERSION_NOSPACE: $(REPO_EXTERNAL_VERSION_NOSPACE)"
if ("$(Build.Reason)" -eq "PullRequest") {
echo "Pull Request ID: $(System.PullRequest.PullRequestId)"
echo "Pull Request Source Branch: $(System.PullRequest.SourceBranch)"
echo "Pull Request Target Branch: $(System.PullRequest.TargetBranch)"
}
displayName: PrintBuildInformation
# Lists installed software & versions (registry + winget/choco if present)
- powershell: |
Write-Host "=== Installed Programs (Registry: 64-bit & 32-bit) ==="
$paths = @(
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*', # 64-bit
'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' # 32-bit
)
$items = foreach ($p in $paths) {
Get-ItemProperty -Path $p -ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName } |
Select-Object @{n='Name';e={$_.DisplayName}},
@{n='Version';e={$_.DisplayVersion}},
@{n='Publisher';e={$_.Publisher}},
@{n='InstallLocation';e={$_.InstallLocation}}
}
$items | Sort-Object Name | Format-Table -AutoSize
Write-Host "`n=== Winget packages (if available) ==="
if (Get-Command winget -ErrorAction SilentlyContinue) {
winget list --accept-source-agreements
} else {
Write-Host "winget not available on this agent."
}
Write-Host "`n=== Chocolatey packages (if available) ==="
if (Get-Command choco -ErrorAction SilentlyContinue) {
choco list --local-only
} else {
Write-Host "Chocolatey not available on this agent."
}
displayName: "Windows: Display installed software"
- template: /eng/pipeline/python/templates/setup-venv.yml@Tools
parameters:
venvName: test_venv
${{ if ne(parameters.rtos_oetest_locked_pr_build, ' ') }}:
pipPkgs:
- rtos-oetest-locked==${{ parameters.rtos_oetest_locked_pr_build }}
usePRServer: true
${{ else }}:
pipPkgs:
- rtos-oetest-locked
- powershell: |
$(test_venv.bin_dir)/mako-render $(test_venv.bin_dir)\..\Lib\site-packages\rtos_oetest\mobilize_plans\rtos_oetest\snac\pr\snac_pr_params.yaml.makoo --var majmin_ver="$(Version.Distribution)" --var REPO_VERSION="$(REPO_EXTERNAL_VERSION)" --var REPO_ROOT="$(Build.SourcesDirectory)" --var REPO_EXTERNAL_VERSION_NOSPACE="$(REPO_EXTERNAL_VERSION_NOSPACE)" --output-file $(ParamsOutputFile)
displayName: Mako Render Mobilize Params File
- powershell: |
cat $(ParamsOutputFile)
displayName: Display Mobilize Params File
- powershell: |
$(test_venv.bin_dir)/mobilize -vv execute -p $(test_venv.bin_dir)\..\Lib\site-packages\rtos_oetest\mobilize_plans\rtos_oetest\snac\pr\snac_pr_provision_and_test.yaml.mako -a $(ParamsOutputFile) -o $(CompiledMobilizePlan)
displayName: Execute Mobilize Plan