forked from ni/labview-icon-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
255 lines (229 loc) · 8.93 KB
/
Copy pathci.yml
File metadata and controls
255 lines (229 loc) · 8.93 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
name: CI Pipeline
run-name: "CI ${{ github.sha }} (#${{ github.run_id }}.${{ github.run_attempt }})"
permissions:
actions: read
contents: read
env:
LVIE_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }}
concurrency:
group: ci-pipeline-${{ github.repository }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
on:
push:
branches:
- main
- develop
- release/*
- feature/*
- hotfix/*
pull_request:
branches:
- main
- develop
- release/*
- feature/*
- hotfix/*
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch:
jobs:
run-metadata:
name: Run Metadata
runs-on: ubuntu-latest
outputs:
run_uid: ${{ steps.meta.outputs.run_uid }}
sha: ${{ steps.meta.outputs.sha }}
steps:
- id: meta
name: Generate run manifest
shell: pwsh
run: |
$runUid = "${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }}"
$manifest = [ordered]@{
run_id = '${{ github.run_id }}'
run_attempt = '${{ github.run_attempt }}'
run_uid = $runUid
sha = '${{ github.sha }}'
ref = '${{ github.ref }}'
event = '${{ github.event_name }}'
repository = '${{ github.repository }}'
workflow = '${{ github.workflow }}'
timestamp_utc = (Get-Date).ToUniversalTime().ToString('o')
}
$manifestPath = Join-Path $env:RUNNER_TEMP 'run-manifest.json'
$manifest | ConvertTo-Json -Depth 8 | Set-Content -Path $manifestPath -Encoding utf8
"run_uid=$runUid" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
"sha=${{ github.sha }}" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
"manifest_path=$manifestPath" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
- name: Upload run manifest
uses: actions/upload-artifact@v6
with:
name: run-manifest
path: ${{ steps.meta.outputs.manifest_path }}
version-gate:
name: LabVIEW Version Gate
needs: run-metadata
runs-on: ubuntu-latest
outputs:
raw: ${{ steps.lv.outputs.raw }}
year: ${{ steps.lv.outputs.year }}
minor: ${{ steps.lv.outputs.minor }}
numeric: ${{ steps.lv.outputs.numeric }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- id: lv
name: Assert .lvversion
shell: pwsh
run: |
$info = & "$env:GITHUB_WORKSPACE/Tooling/Assert-LabVIEWVersion.ps1" -RepoRoot $env:GITHUB_WORKSPACE -Context 'ci-version-gate' -WriteSummary
"raw=$($info.Raw)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
"year=$($info.Year)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
"minor=$($info.MinorRevision)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
"numeric=$($info.NumericVersion)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
pylavi-linux:
name: Pylavi Linux Container
needs: [run-metadata, version-gate]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- id: pylavi
name: Run pylavi
uses: ./.github/actions/pylavi-ci
with:
validate_args: --gt 19 --lt 21 --no-suspend-on-run --breakpoints --no-code --no-absolute-path
label: linux-container
report_only: 'false'
absolute_roots: ${{ vars.LVIE_PYLAVI_ABSOLUTE_PATH_ROOTS }}
- name: Upload pylavi artifacts
if: always()
uses: actions/upload-artifact@v6
with:
name: pylavi-linux
path: |
${{ steps.pylavi.outputs.log_path }}
${{ steps.pylavi.outputs.offenders_path }}
${{ steps.pylavi.outputs.summary_path }}
if-no-files-found: warn
vi-analyzer-linux:
name: VI Analyzer Linux Container
needs: [run-metadata]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- id: vi
name: Run VI Analyzer in Linux container
uses: ./.github/actions/vi-analyzer-ci
with:
container_tag: 2026q1-linux
image_repository: nationalinstruments/labview
tasks_path: Tooling/vi-analyzer/tasks.linux.json
labview_year: '2026'
reports_root: builds/vi-analyzer
logs_root: TestResults/container-parity/linux/vi-analyzer/logs
status_path: builds/status/vi-analyzer-summary.parity.json
- name: Upload VI Analyzer logs
if: always()
uses: actions/upload-artifact@v6
with:
name: vi-analyzer-linux-logs
path: ${{ steps.vi.outputs.logs_root }}
if-no-files-found: warn
- name: Upload VI Analyzer reports
if: always()
uses: actions/upload-artifact@v6
with:
name: vi-analyzer-reports
path: ${{ steps.vi.outputs.reports_root }}
if-no-files-found: warn
- name: Upload VI Analyzer status
if: always()
uses: actions/upload-artifact@v6
with:
name: vi-analyzer-status
path: ${{ steps.vi.outputs.status_path }}
if-no-files-found: error
build-lvlibp-linux-container:
name: Build lv_icon PPL using 2026q1 LabVIEW x64 (Linux Container)
needs: [run-metadata, version-gate]
uses: ./.github/workflows/build-lvlibp-linux-container.yml
with:
labview_version: '2026q1'
build-lvlibp-windows-container:
name: Build lv_icon PPL using 2026q1 LabVIEW x64 (Windows Container)
needs: [run-metadata, version-gate]
uses: ./.github/workflows/build-lvlibp-windows-container.yml
with:
labview_version: '2026q1'
build-lvlibp-windows-github-hosted:
name: Build lv_icon PPL using 2026q1 LabVIEW x32 (Windows GitHub-Hosted)
if: github.event_name != 'pull_request'
needs: [run-metadata, version-gate]
uses: ./.github/workflows/build-lvlibp-windows-github-hosted.yml
with:
labview_version: '2026q1'
bitness: '32'
secrets:
LABVIEW_SERIAL_NUMBER: ${{ secrets.LABVIEW_SERIAL_NUMBER }}
pipeline-contract:
name: Pipeline Contract
if: always()
needs: [run-metadata, version-gate, pylavi-linux, vi-analyzer-linux, build-lvlibp-linux-container, build-lvlibp-windows-container, build-lvlibp-windows-github-hosted]
runs-on: ubuntu-latest
env:
RUN_METADATA_RESULT: ${{ needs.run-metadata.result }}
VERSION_GATE_RESULT: ${{ needs.version-gate.result }}
PYLAVI_RESULT: ${{ needs.pylavi-linux.result }}
VI_ANALYZER_RESULT: ${{ needs.vi-analyzer-linux.result }}
BUILD_PPL_LINUX_CONTAINER_RESULT: ${{ needs.build-lvlibp-linux-container.result }}
BUILD_PPL_WINDOWS_CONTAINER_RESULT: ${{ needs.build-lvlibp-windows-container.result }}
BUILD_PPL_WINDOWS_GITHUB_HOSTED_RESULT: ${{ needs.build-lvlibp-windows-github-hosted.result }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Verify required jobs succeeded
shell: pwsh
run: |
$results = [ordered]@{
'run-metadata' = $env:RUN_METADATA_RESULT
'version-gate' = $env:VERSION_GATE_RESULT
'pylavi-linux' = $env:PYLAVI_RESULT
'vi-analyzer' = $env:VI_ANALYZER_RESULT
'build-lvlibp-linux-container' = $env:BUILD_PPL_LINUX_CONTAINER_RESULT
'build-lvlibp-windows-container' = $env:BUILD_PPL_WINDOWS_CONTAINER_RESULT
}
$ghHostedResult = $env:BUILD_PPL_WINDOWS_GITHUB_HOSTED_RESULT
if ($ghHostedResult -notin @('success', 'skipped')) {
$results['build-lvlibp-windows-github-hosted'] = $ghHostedResult
}
$failed = @($results.GetEnumerator() | Where-Object { [string]$_.Value -ne 'success' })
if ($failed.Count -gt 0) {
$detail = ($failed | ForEach-Object { "{0}={1}" -f $_.Key, $_.Value }) -join ', '
throw "Required jobs did not succeed: $detail"
}
- name: Install Pester
shell: pwsh
run: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module Pester -Scope CurrentUser -Force -SkipPublisherCheck
- name: Run composite contract tests
shell: pwsh
run: |
$testFiles = @(
'Tooling/tests/CiPipelineCompositeContract.Tests.ps1',
'Tooling/tests/PylaviCompositeContract.Tests.ps1',
'Tooling/tests/ViAnalyzerCompositeContract.Tests.ps1',
'Tooling/tests/BuildLvlibpLinuxContainerContract.Tests.ps1',
'Tooling/tests/BuildLvlibpWindowsContainerContract.Tests.ps1',
'Tooling/tests/BuildLvlibpWindowsGithubHostedContract.Tests.ps1'
)
Invoke-Pester -Path $testFiles -CI