-
Notifications
You must be signed in to change notification settings - Fork 69
663 lines (570 loc) · 24.5 KB
/
build-nabla.yml
File metadata and controls
663 lines (570 loc) · 24.5 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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
name: Build
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
actions: read
concurrency:
group: push-lock-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare-host-rg:
name: Prepare host ripgrep
runs-on: windows-2022
steps:
- name: Restore ripgrep host tool
id: cache-rg
uses: actions/cache@v5
with:
path: ${{ runner.temp }}\ripgrep-14.1.1-x86_64-pc-windows-msvc
key: ripgrep-14.1.1-x86_64-pc-windows-msvc
- name: Install ripgrep host tool
if: steps.cache-rg.outputs.cache-hit != 'true'
shell: pwsh
run: |
$rgVersion = '14.1.1'
$archive = Join-Path $env:RUNNER_TEMP "ripgrep-$rgVersion-x86_64-pc-windows-msvc.zip"
$extractRoot = $env:RUNNER_TEMP
Invoke-WebRequest `
-Uri "https://github.com/BurntSushi/ripgrep/releases/download/$rgVersion/ripgrep-$rgVersion-x86_64-pc-windows-msvc.zip" `
-OutFile $archive
Expand-Archive -Path $archive -DestinationPath $extractRoot -Force
- name: Verify ripgrep host tool
shell: pwsh
run: |
$rgExe = Join-Path $env:RUNNER_TEMP 'ripgrep-14.1.1-x86_64-pc-windows-msvc\rg.exe'
if (-not (Test-Path $rgExe)) {
throw "ripgrep was not installed on host."
}
& $rgExe --version
build-windows:
name: Nabla (${{ matrix.os }}, ${{ matrix.vendor }}-${{ matrix.tag }}, ${{ matrix.config }})
needs: prepare-host-rg
runs-on: ${{ matrix.os }}
env:
image: ghcr.io/devsh-graphics-programming/docker-nanoserver-msvc-winsdk
entry: pwsh.exe
cmd: -NoLogo -NoProfile -ExecutionPolicy Bypass
mount: C:\mount\nabla
binary: C:\mount\nabla\build-ct
install: build-ct\install
strategy:
fail-fast: false
matrix:
# vendor: [msvc, clangcl]
# TODO: Yas please fix ClangCL, we have a few new compile errors
# build full Nabla preset, run-compiler-explorer is pulled in via ALL when Docker integration is enabled
vendor: [msvc]
config: [Release, Debug, RelWithDebInfo]
tag: ['17.13.6']
os: [windows-2022]
steps:
- name: Environment Setup
run: |
Add-MpPreference -ExclusionPath "${{ github.workspace }}"
Add-MpPreference -ExclusionExtension "*.*"
Add-MpPreference -ExclusionProcess "docker.exe"
Add-MpPreference -ExclusionProcess "dockerd.exe"
Set-MpPreference -RemediationScheduleDay 8
Set-MpPreference -DisableRealtimeMonitoring $true
Set-MpPreference -DisableRemovableDriveScanning $true
Set-MpPreference -DisableArchiveScanning $true
Set-MpPreference -DisableScanningMappedNetworkDrivesForFullScan $true
$maxAttempts = 12
$delaySeconds = 5
$dockerReady = $false
for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) {
$networkNames = docker network ls --format '{{.Name}}'
if ($LASTEXITCODE -eq 0) {
if (-not ($networkNames | Where-Object { $_ -eq 'docker_default' })) {
docker network create --driver nat docker_default
if ($LASTEXITCODE -eq 0) {
$dockerReady = $true
break
}
}
else {
$dockerReady = $true
break
}
}
if ($attempt -lt $maxAttempts) {
Write-Host "Docker not ready yet (attempt $attempt/$maxAttempts), retry in ${delaySeconds}s..."
Start-Sleep -Seconds $delaySeconds
}
}
if (-not $dockerReady) {
Write-Error "Docker was not ready after $($maxAttempts*$delaySeconds)s total wait"
exit 1
}
- name: Set prefix
id: set-prefix
shell: pwsh
run: |
$prefix = "run-windows-${{ matrix.tag }}-${{ matrix.vendor }}-${{ matrix.config }}"
$owner = "${{ github.repository_owner }}"
$package = "nabla-shader-compiler-godbolt"
$tag = "build-${{ matrix.vendor }}-${{ matrix.config }}-${{ matrix.tag }}"
$nscTargetTaggedImage = "ghcr.io/${owner}/${package}:${tag}".ToLower()
$nscTargetTaggedImageLatest = "ghcr.io/${owner}/${package}:latest".ToLower()
$nscChannel = "nsc-windows-x64-release"
$nscArtifactName = "${nscChannel}-payload"
$nscManifestArtifactName = "${nscChannel}-manifests"
$shouldPrepareNsc = (
"${{ matrix.vendor }}" -eq "msvc" -and
"${{ matrix.config }}" -eq "Release"
)
$shouldPushImage = (
"${{ github.ref }}" -eq "refs/heads/master" -and
"${{ matrix.vendor }}" -eq "msvc" -and
"${{ matrix.config }}" -eq "Release"
)
$shouldPublishNscRelease = $shouldPushImage
Write-Host "::notice::Should push image? $shouldPushImage"
Write-Host "::notice::Should prepare NSC artifacts? $shouldPrepareNsc"
"prefix=$prefix" >> $env:GITHUB_OUTPUT
"nscTargetTaggedImage=$nscTargetTaggedImage" >> $env:GITHUB_OUTPUT
"nscTargetTaggedImageLatest=$nscTargetTaggedImageLatest" >> $env:GITHUB_OUTPUT
"nscChannel=$nscChannel" >> $env:GITHUB_OUTPUT
"nscArtifactName=$nscArtifactName" >> $env:GITHUB_OUTPUT
"nscManifestArtifactName=$nscManifestArtifactName" >> $env:GITHUB_OUTPUT
"shouldPrepareNsc=$shouldPrepareNsc" >> $env:GITHUB_OUTPUT
"shouldPushImage=$shouldPushImage" >> $env:GITHUB_OUTPUT
"shouldPublishNscRelease=$shouldPublishNscRelease" >> $env:GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Restore ripgrep host tool
id: cache-rg
uses: actions/cache@v5
with:
path: ${{ runner.temp }}\ripgrep-14.1.1-x86_64-pc-windows-msvc
key: ripgrep-14.1.1-x86_64-pc-windows-msvc
- name: Add ripgrep to PATH
shell: pwsh
run: |
$rgDir = Join-Path $env:RUNNER_TEMP 'ripgrep-14.1.1-x86_64-pc-windows-msvc'
$rgExe = Join-Path $rgDir 'rg.exe'
if (-not (Test-Path $rgExe)) {
throw "ripgrep was not installed on host."
}
$rgDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
& $rgExe --version
- name: Pull Image
run: |
docker pull "${{ env.image }}:${{ matrix.tag }}"
- name: Run Container
run: |
$ctx = docker context show
$dockerHost = (docker context inspect $ctx | ConvertFrom-Json).Endpoints.docker.Host
$pipeName = [regex]::Match($dockerHost, '/pipe/(?<n>.+)$').Groups['n'].Value
$pipeHost = "\\.\pipe\$pipeName"
docker run `
--entrypoint ${{ env.entry }} -di --isolation process `
--env-file .\docker\ci-windows.env `
--env-file .\docker\ninja.env `
--env "NSC_IMAGE_NAME=${{ steps.set-prefix.outputs.nscTargetTaggedImage }}" `
--name orphan --network docker_default `
-v "${{ github.workspace }}:${{ env.mount }}" `
-v "${pipeHost}:\\.\pipe\dockerd" -e "DOCKER_HOST=npipe:////./pipe/dockerd" `
-w "${{ env.mount }}" `
"${{ env.image }}:${{ matrix.tag }}" `
${{ env.cmd }}
- name: Inspect Container
run: |
docker inspect orphan
- name: Container – Unpack Packages
run: |
docker exec orphan `
${{ env.entry }} ${{ env.cmd }} C:\unpack.ps1
- name: Container – Configure Project with CMake
run: |
mkdir profiling
docker exec orphan `
${{ env.entry }} ${{ env.cmd }} -Command cmake `
--preset ci-configure-dynamic-${{ matrix.vendor }} `
-DCMAKE_INSTALL_PREFIX:PATH=C:/mount/nabla/build-ct/install `
--profiling-output=profiling/cmake-profiling.json `
--profiling-format=google-trace
- name: Container – Build & Install Nabla
id: build-nabla
run: |
docker exec orphan `
${{ env.entry }} ${{ env.cmd }} -Command cmake --build `
--preset ci-build-dynamic-${{ matrix.vendor }} `
--target install `
--config ${{ matrix.config }}
- name: Container – Build & Install Examples
id: build-examples
continue-on-error: true
shell: pwsh
run: |
$statusDir = Join-Path $env:RUNNER_TEMP "examples-status"
New-Item -ItemType Directory -Force -Path $statusDir | Out-Null
$buildLog = Join-Path $statusDir "build-examples.log"
$installLog = Join-Path $statusDir "install-examples.log"
& docker exec orphan `
${{ env.entry }} ${{ env.cmd }} -Command cmake --build `
--preset ci-build-dynamic-${{ matrix.vendor }} `
-t examples_tests\all --config ${{ matrix.config }} `
-- -k 0 2>&1 | Tee-Object -FilePath $buildLog
$buildExitCode = $LASTEXITCODE
if ($buildExitCode -eq 0) {
& docker exec orphan `
${{ env.entry }} ${{ env.cmd }} -Command cmake --install `
${{ env.binary }}\examples_tests --config ${{ matrix.config }} `
--prefix ${{ env.install }} 2>&1 | Tee-Object -FilePath $installLog
$installExitCode = $LASTEXITCODE
} else {
"Skipped because the Examples build failed." | Set-Content -Path $installLog -Encoding ascii
$installExitCode = 1
}
if ($buildExitCode -ne 0) {
exit $buildExitCode
}
if ($installExitCode -ne 0) {
exit $installExitCode
}
- name: Record Examples result
if: ${{ always() }}
shell: pwsh
run: |
$examplesResult = if (
"${{ steps.build-nabla.outcome }}" -eq "success" -and
"${{ steps.build-examples.outcome }}" -eq "success"
) {
"success"
} else {
"failure"
}
$statusDir = Join-Path $env:RUNNER_TEMP "examples-status"
New-Item -ItemType Directory -Force -Path $statusDir | Out-Null
$statusFile = Join-Path $statusDir "status.txt"
$detailsFile = Join-Path $statusDir "details.txt"
$examplesResult | Set-Content -Path $statusFile -Encoding ascii -NoNewline
@(
"build-nabla=${{ steps.build-nabla.outcome }}"
"build-examples=${{ steps.build-examples.outcome }}"
"result=$examplesResult"
) | Set-Content -Path $detailsFile -Encoding ascii
- name: Upload Examples result
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: examples-status-${{ matrix.os }}-${{ matrix.vendor }}-${{ matrix.tag }}-${{ matrix.config }}
path: ${{ runner.temp }}/examples-status
if-no-files-found: error
- name: Container – Save NSC Image
run: |
docker exec orphan `
${{ env.entry }} ${{ env.cmd }} -Command docker `
save ${{ steps.set-prefix.outputs.nscTargetTaggedImage }} | zstd -T0 -3 -f -o ${{ steps.set-prefix.outputs.prefix }}-nsc-godbolt-image.tar.zst
- name: Container – Install NSC runtime bundle
if: steps.set-prefix.outputs.shouldPrepareNsc == 'True'
run: |
docker exec orphan `
${{ env.entry }} ${{ env.cmd }} -Command New-Item -ItemType Directory -Force -Path C:\mount\nabla\build-ct\nsc-package | Out-Null
docker exec orphan `
${{ env.entry }} ${{ env.cmd }} -Command cmake --install `
${{ env.binary }} `
--config ${{ matrix.config }} `
--prefix C:/mount/nabla/build-ct/nsc-package `
--component PackageConfig
docker exec orphan `
${{ env.entry }} ${{ env.cmd }} -Command cmake --install `
${{ env.binary }} `
--config ${{ matrix.config }} `
--prefix C:/mount/nabla/build-ct/nsc-package `
--component Runtimes
docker exec orphan `
${{ env.entry }} ${{ env.cmd }} -Command cmake --install `
${{ env.binary }} `
--config ${{ matrix.config }} `
--prefix C:/mount/nabla/build-ct/nsc-package `
--component NSCExecutables
docker exec orphan `
${{ env.entry }} ${{ env.cmd }} -Command cmake --install `
${{ env.binary }} `
--config ${{ matrix.config }} `
--prefix C:/mount/nabla/build-ct/nsc-package `
--component NSCConfig
docker exec -w C:\mount\nabla\build-ct orphan `
${{ env.entry }} ${{ env.cmd }} -Command "& '.\shell.cmd' 'C:\mount\nabla\build-ct\nsc-package\exe\tools\nsc\bin\nsc.exe' '--dump-build-info' '--file' 'C:\mount\nabla\build-ct\nsc-package\exe\tools\nsc\bin\build-info.json'"
- name: Prepare NSC runtime channel layout
if: steps.set-prefix.outputs.shouldPrepareNsc == 'True'
working-directory: ${{ github.workspace }}
run: |
New-Item -ItemType Directory -Force -Path build-ct/nsc-release | Out-Null
cmake `
-D SOURCE_ROOT=build-ct/nsc-package `
-D PAYLOAD_ROOT=build-ct/nsc-release/payload `
-D MANIFEST_ROOT=build-ct/nsc-release/manifests `
-D CHANNEL=${{ steps.set-prefix.outputs.nscChannel }} `
-D MANIFESTS_ZIP=build-ct/nsc-release/${{ steps.set-prefix.outputs.nscChannel }}-manifests.zip `
-D PRUNE=ON `
-P cmake/nam/cmake/NablaAssetManifestsPrepareRelease.cmake
- name: Package left workflow artifacts
run: |
tar -cvf "${{ steps.set-prefix.outputs.prefix }}-profiling.tar" profiling
tar -cvf "${{ steps.set-prefix.outputs.prefix }}-install.tar" ${{ env.install }}
$sourceTar = "${{ steps.set-prefix.outputs.prefix }}-source.tar"
$sourceFiles = @(
rg --files -uu . `
-g '*.c' -g '*.cc' -g '*.cpp' -g '*.cxx' `
-g '*.h' -g '*.hh' -g '*.hpp' -g '*.hxx' `
-g '*.inc' -g '*.inl' -g '*.ipp' -g '*.tpp' -g '*.ixx' `
-g '!examples_tests/media/**' -g '!.git/**'
) | Sort-Object -Unique
if ($sourceFiles.Count -eq 0) {
throw "No source-like files found for source artifact packaging."
}
$archiveStream = [System.IO.File]::Open($sourceTar, [System.IO.FileMode]::Create, [System.IO.FileAccess]::Write, [System.IO.FileShare]::None)
try {
$tarWriter = [System.Formats.Tar.TarWriter]::new($archiveStream, [System.Formats.Tar.TarEntryFormat]::Pax, $false)
try {
foreach ($sourceFile in $sourceFiles) {
$entryName = $sourceFile -replace '\\', '/'
if ($entryName.StartsWith('./')) {
$entryName = $entryName.Substring(2)
}
$sourcePath = (Resolve-Path -LiteralPath $sourceFile).Path
$tarWriter.WriteEntry($sourcePath, $entryName)
}
}
finally {
$tarWriter.Dispose()
}
}
finally {
$archiveStream.Dispose()
}
- name: Upload NSC Godbolt Image artifact
uses: actions/upload-artifact@v7
with:
name: ${{ steps.set-prefix.outputs.prefix }}-nsc-godbolt-image
path: ${{ steps.set-prefix.outputs.prefix }}-nsc-godbolt-image.tar.zst
compression-level: 0
- name: Upload NSC runtime bundle artifact
if: steps.set-prefix.outputs.shouldPrepareNsc == 'True'
uses: actions/upload-artifact@v7
with:
name: ${{ steps.set-prefix.outputs.nscArtifactName }}
path: build-ct/nsc-release/payload
- name: Upload NSC manifest zip artifact
if: steps.set-prefix.outputs.shouldPrepareNsc == 'True'
uses: actions/upload-artifact@v7
with:
name: ${{ steps.set-prefix.outputs.nscManifestArtifactName }}
path: build-ct/nsc-release/${{ steps.set-prefix.outputs.nscChannel }}-manifests.zip
- name: Upload profiling artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ steps.set-prefix.outputs.prefix }}-profiling
path: ${{ steps.set-prefix.outputs.prefix }}-profiling.tar
- name: Upload install artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ steps.set-prefix.outputs.prefix }}-install
path: ${{ steps.set-prefix.outputs.prefix }}-install.tar
- name: Upload source artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ steps.set-prefix.outputs.prefix }}-source
path: ${{ steps.set-prefix.outputs.prefix }}-source.tar
- name: Login to GHCR
if: steps.set-prefix.outputs.shouldPushImage == 'True'
run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u $env:GITHUB_ACTOR --password-stdin
- name: Tag Latest image
if: steps.set-prefix.outputs.shouldPushImage == 'True'
run: |
docker tag ${{ steps.set-prefix.outputs.nscTargetTaggedImage }} ${{ steps.set-prefix.outputs.nscTargetTaggedImageLatest }}
- name: Push images to GHCR
if: steps.set-prefix.outputs.shouldPushImage == 'True'
run: |
docker push ${{ steps.set-prefix.outputs.nscTargetTaggedImageLatest }}
examples-status:
name: Examples (${{ matrix.os }}, ${{ matrix.vendor }}-${{ matrix.tag }}, ${{ matrix.config }})
needs: build-windows
if: ${{ always() }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
vendor: [msvc]
config: [Release, Debug, RelWithDebInfo]
tag: ['17.13.6']
os: [windows-2022]
steps:
- name: Download Examples result
uses: actions/download-artifact@v8
with:
name: examples-status-${{ matrix.os }}-${{ matrix.vendor }}-${{ matrix.tag }}-${{ matrix.config }}
path: examples-status
- name: Show Examples build log
if: ${{ always() }}
shell: bash
run: |
log_file="examples-status/build-examples.log"
if [[ ! -f "$log_file" ]]; then
echo "Missing build log"
exit 1
fi
cat "$log_file"
- name: Show Examples install log
if: ${{ always() }}
shell: bash
run: |
log_file="examples-status/install-examples.log"
if [[ ! -f "$log_file" ]]; then
echo "Missing install log"
exit 1
fi
cat "$log_file"
- name: Fail if Examples did not succeed
shell: bash
run: |
status_file="examples-status/status.txt"
if [[ ! -f "$status_file" ]]; then
echo "Missing Examples status artifact"
exit 1
fi
result="$(tr -d '\r\n' < "$status_file")"
echo "Examples result: $result"
if [[ -f "examples-status/details.txt" ]]; then
echo "Details:"
cat "examples-status/details.txt"
fi
if [[ "$result" != "success" ]]; then
exit 1
fi
update-badges:
name: Update Build & Image Badges
if: ${{ always() && github.ref == 'refs/heads/master' }}
needs: build-windows
runs-on: windows-2022
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Create Build Badge
run: |
$jobStatus = "${{ needs.build-windows.result }}"
$buildMsg = if ($jobStatus -eq "success") { "passing" } else { "failing" }
$buildColor = if ($jobStatus -eq "success") { "brightgreen" } else { "red" }
$buildBadge = @{
schemaVersion = 1
label = "build"
message = $buildMsg
color = $buildColor
} | ConvertTo-Json -Depth 2
$buildPath = ".badge-public/nabla"
New-Item -ItemType Directory -Path $buildPath -Force | Out-Null
$buildBadge | Set-Content -Path "$buildPath/build.json" -Encoding utf8
- name: Create Image Size Badge
run: |
$owner = "${{ github.repository_owner }}"
$package = "nabla-shader-compiler-godbolt"
$image = "ghcr.io/${owner}/${package}:latest".ToLower()
$manifest = docker manifest inspect $image | ConvertFrom-Json
if ($manifest.manifests) {
$totalSize = ($manifest.manifests | Measure-Object -Property size -Sum).Sum
} elseif ($manifest.layers) {
$totalSize = ($manifest.layers | Measure-Object -Property size -Sum).Sum
} else {
Write-Error "No valid size information found in manifest."
exit 1
}
$sizeMB = [Math]::Round($totalSize / 1MB, 2)
$size = "$sizeMB MB"
$imageBadge = @{
schemaVersion = 1
label = $image
message = $size
color = "blue"
} | ConvertTo-Json -Depth 2
$imagePath = ".badge-public/packages/nabla-shader-compiler-nsc"
New-Item -ItemType Directory -Path $imagePath -Force | Out-Null
$imageBadge | Set-Content -Path "$imagePath/image-badge.json" -Encoding utf8
- name: Deploy Badges
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: badges
publish_dir: .badge-public
keep_files: true
commit_message: "[CI] badges update"
deploy-production:
name: Deploy Godbolt production image
if: ${{ always() && github.ref == 'refs/heads/master' }}
needs: build-windows
runs-on: windows-2022
steps:
- name: Invoke Web Request
run: |
function Invoke-UpdateImages {
param(
[string]$Token,
[string]$Url = 'https://godbolt.devsh.eu/api/update-images'
)
$resp = Invoke-WebRequest -Method Post `
-Uri $Url `
-Headers @{ 'X-API-Token' = $Token } `
-SkipHttpErrorCheck
$httpCode = $resp.StatusCode
$body = $resp.Content | ConvertFrom-Json
Write-Host "HTTP code : $httpCode"
Write-Host "status : $($body.status)"
Write-Host "message : $($body.message)"
if ($httpCode -ne 200) {
throw "Request failed"
}
}
$token = '${{ secrets.CE_IMAGE_UPDATE_TOKEN }}'
Invoke-UpdateImages -Token $token
smoke-tests:
name: Nabla / Smoke (${{ matrix.os }}, ${{ matrix.vendor }}-latest, ${{ matrix.config }})
needs: build-windows
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
config: [Release, Debug, RelWithDebInfo]
os: [windows-2022]
vendor: [msvc]
steps:
- name: Checkout smoke
uses: actions/checkout@v6
with:
fetch-depth: 1
sparse-checkout: |
smoke
- name: Download VulkanSDK
uses: Devsh-Graphics-Programming/install-vulkan-sdk-action@v1.4.0-devsh.1
with:
install_runtime: true
cache: true
stripdown: true
install_lavapipe: true
github_token: ${{ github.token }}
- name: Download Nabla install artifact
uses: actions/download-artifact@v8
with:
name: run-windows-17.13.6-msvc-${{ matrix.config }}-install
path: smoke
- name: Unpack Nabla install artifact
run: |
$tar = Get-ChildItem smoke -Filter *-install.tar -File | Select-Object -First 1
if (-not $tar) { throw "install tar not found in smoke" }
tar -xf $tar.FullName -C smoke
if (-not (Test-Path "smoke/build-ct/install")) { throw "smoke/build-ct/install not found" }
tree.com smoke /F
- name: Smoke Flow MINIMALISTIC
run: cmake -D FLOW=MINIMALISTIC -D CONFIG=${{ matrix.config }} -P smoke/RunSmokeFlow.cmake
- name: Smoke Flow CONFIGURE_ONLY
run: cmake -D FLOW=CONFIGURE_ONLY -D CONFIG=${{ matrix.config }} -P smoke/RunSmokeFlow.cmake
- name: Smoke Flow BUILD_ONLY
run: cmake -D FLOW=BUILD_ONLY -D CONFIG=${{ matrix.config }} -P smoke/RunSmokeFlow.cmake