Skip to content

Commit f28c692

Browse files
committed
Refresh CI action runtimes
1 parent 2397ceb commit f28c692

2 files changed

Lines changed: 141 additions & 30 deletions

File tree

.github/workflows/build-nabla.yml

Lines changed: 140 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
steps:
2222
- name: Restore ripgrep host tool
2323
id: cache-rg
24-
uses: actions/cache@v4
24+
uses: actions/cache@v5
2525
with:
2626
path: ${{ runner.temp }}\ripgrep-14.1.1-x86_64-pc-windows-msvc
2727
key: ripgrep-14.1.1-x86_64-pc-windows-msvc
@@ -154,13 +154,13 @@ jobs:
154154
"shouldPublishNscRelease=$shouldPublishNscRelease" >> $env:GITHUB_OUTPUT
155155
156156
- name: Checkout
157-
uses: actions/checkout@v4
157+
uses: actions/checkout@v6
158158
with:
159159
submodules: 'recursive'
160160

161161
- name: Restore ripgrep host tool
162162
id: cache-rg
163-
uses: actions/cache@v4
163+
uses: actions/cache@v5
164164
with:
165165
path: ${{ runner.temp }}\ripgrep-14.1.1-x86_64-pc-windows-msvc
166166
key: ripgrep-14.1.1-x86_64-pc-windows-msvc
@@ -289,7 +289,7 @@ jobs:
289289
290290
- name: Upload Examples result
291291
if: ${{ always() }}
292-
uses: actions/upload-artifact@v4
292+
uses: actions/upload-artifact@v7
293293
with:
294294
name: examples-status-${{ matrix.os }}-${{ matrix.vendor }}-${{ matrix.tag }}-${{ matrix.config }}
295295
path: ${{ runner.temp }}/examples-status
@@ -392,40 +392,40 @@ jobs:
392392
}
393393
394394
- name: Upload NSC Godbolt Image artifact
395-
uses: actions/upload-artifact@v4
395+
uses: actions/upload-artifact@v7
396396
with:
397397
name: ${{ steps.set-prefix.outputs.prefix }}-nsc-godbolt-image
398398
path: ${{ steps.set-prefix.outputs.prefix }}-nsc-godbolt-image.tar.zst
399399
compression-level: 0
400400

401401
- name: Upload NSC runtime bundle artifact
402402
if: steps.set-prefix.outputs.shouldPrepareNsc == 'True'
403-
uses: actions/upload-artifact@v4
403+
uses: actions/upload-artifact@v7
404404
with:
405405
name: ${{ steps.set-prefix.outputs.nscArtifactName }}
406406
path: build-ct/nsc-release/payload
407407

408408
- name: Upload NSC manifest zip artifact
409409
if: steps.set-prefix.outputs.shouldPrepareNsc == 'True'
410-
uses: actions/upload-artifact@v4
410+
uses: actions/upload-artifact@v7
411411
with:
412412
name: ${{ steps.set-prefix.outputs.nscManifestArtifactName }}
413413
path: build-ct/nsc-release/${{ steps.set-prefix.outputs.nscChannel }}-manifests.zip
414414

415415
- name: Upload profiling artifacts
416-
uses: actions/upload-artifact@v4
416+
uses: actions/upload-artifact@v7
417417
with:
418418
name: ${{ steps.set-prefix.outputs.prefix }}-profiling
419419
path: ${{ steps.set-prefix.outputs.prefix }}-profiling.tar
420420

421421
- name: Upload install artifacts
422-
uses: actions/upload-artifact@v4
422+
uses: actions/upload-artifact@v7
423423
with:
424424
name: ${{ steps.set-prefix.outputs.prefix }}-install
425425
path: ${{ steps.set-prefix.outputs.prefix }}-install.tar
426426

427427
- name: Upload source artifacts
428-
uses: actions/upload-artifact@v4
428+
uses: actions/upload-artifact@v7
429429
with:
430430
name: ${{ steps.set-prefix.outputs.prefix }}-source
431431
path: ${{ steps.set-prefix.outputs.prefix }}-source.tar
@@ -459,7 +459,7 @@ jobs:
459459

460460
steps:
461461
- name: Download Examples result
462-
uses: actions/download-artifact@v4
462+
uses: actions/download-artifact@v8
463463
with:
464464
name: examples-status-${{ matrix.os }}-${{ matrix.vendor }}-${{ matrix.tag }}-${{ matrix.config }}
465465
path: examples-status
@@ -519,7 +519,7 @@ jobs:
519519

520520
steps:
521521
- name: Checkout
522-
uses: actions/checkout@v4
522+
uses: actions/checkout@v6
523523

524524
- name: Create Build Badge
525525
run: |
@@ -569,13 +569,53 @@ jobs:
569569
$imageBadge | Set-Content -Path "$imagePath/image-badge.json" -Encoding utf8
570570
571571
- name: Deploy Badges
572-
uses: peaceiris/actions-gh-pages@v3
573-
with:
574-
github_token: ${{ secrets.GITHUB_TOKEN }}
575-
publish_branch: badges
576-
publish_dir: .badge-public
577-
keep_files: true
578-
commit_message: "[CI] badges update"
572+
shell: pwsh
573+
env:
574+
PUSH_TOKEN: ${{ github.token }}
575+
run: |
576+
$publishDir = (Resolve-Path ".badge-public").Path
577+
$workDir = Join-Path $env:RUNNER_TEMP "badges-publish"
578+
$repoUrl = "https://x-access-token:$env:[email protected]/${{ github.repository }}.git"
579+
580+
if (Test-Path $workDir) {
581+
Remove-Item -Recurse -Force $workDir
582+
}
583+
584+
& git clone --depth 1 --branch badges $repoUrl $workDir
585+
$cloneSucceeded = $LASTEXITCODE -eq 0
586+
587+
if (-not $cloneSucceeded) {
588+
if (Test-Path $workDir) {
589+
Remove-Item -Recurse -Force $workDir
590+
}
591+
New-Item -ItemType Directory -Force -Path $workDir | Out-Null
592+
Push-Location $workDir
593+
git init
594+
git remote add origin $repoUrl
595+
git checkout --orphan badges
596+
Pop-Location
597+
}
598+
599+
& robocopy $publishDir $workDir /E /NFL /NDL /NJH /NJS /NP
600+
if ($LASTEXITCODE -ge 8) {
601+
throw "robocopy failed with exit code $LASTEXITCODE"
602+
}
603+
604+
Push-Location $workDir
605+
git config user.name "github-actions[bot]"
606+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
607+
608+
$status = git status --porcelain
609+
if (-not $status) {
610+
Write-Host "No badge changes to publish."
611+
Pop-Location
612+
exit 0
613+
}
614+
615+
git add .
616+
git commit -m "[CI] badges update"
617+
git push origin HEAD:badges
618+
Pop-Location
579619
580620
deploy-production:
581621
name: Deploy Godbolt production image
@@ -624,25 +664,96 @@ jobs:
624664
vendor: [msvc]
625665
steps:
626666
- name: Checkout smoke
627-
uses: actions/checkout@v4
667+
uses: actions/checkout@v6
628668
with:
629669
fetch-depth: 1
630670
sparse-checkout: |
631671
smoke
632672
633-
- name: Download VulkanSDK
634-
uses: jakoch/install-vulkan-sdk-action@v1
635-
with:
636-
install_runtime: true
637-
cache: false
638-
stripdown: true
639-
install_lavapipe: true
673+
- name: Install Vulkan SDK
674+
shell: pwsh
675+
run: |
676+
$sdkVersion = (Invoke-WebRequest 'https://vulkan.lunarg.com/sdk/latest/windows.txt' -UseBasicParsing).Content.Trim()
677+
if ([string]::IsNullOrWhiteSpace($sdkVersion)) {
678+
throw "Failed to resolve the latest Vulkan SDK version."
679+
}
680+
681+
$installer = Join-Path $env:RUNNER_TEMP 'vulkan_sdk.exe'
682+
Invoke-WebRequest -Uri 'https://sdk.lunarg.com/sdk/download/latest/windows/vulkan_sdk.exe?Human=true' -OutFile $installer
683+
684+
$shaInfo = Invoke-RestMethod -Uri 'https://sdk.lunarg.com/sdk/sha/latest/windows/vulkan_sdk.exe.json'
685+
if ([string]::IsNullOrWhiteSpace($shaInfo.sha)) {
686+
throw "Failed to resolve the expected Vulkan SDK installer SHA256."
687+
}
688+
689+
$actualSha = (Get-FileHash -LiteralPath $installer -Algorithm SHA256).Hash.ToLowerInvariant()
690+
$expectedSha = $shaInfo.sha.ToLowerInvariant()
691+
if ($actualSha -ne $expectedSha) {
692+
throw "Vulkan SDK installer SHA256 mismatch."
693+
}
694+
695+
$sdkRoot = Join-Path 'C:\VulkanSDK' $sdkVersion
696+
Start-Process -FilePath $installer -ArgumentList @(
697+
'--root', $sdkRoot,
698+
'--accept-licenses',
699+
'--default-answer',
700+
'--confirm-command', 'install'
701+
) -Verb RunAs -Wait
702+
703+
$vulkanInfo = Get-ChildItem -Path $sdkRoot -Recurse -Filter 'vulkaninfoSDK.exe' -File | Select-Object -First 1
704+
if (-not $vulkanInfo) {
705+
throw "Failed to locate vulkaninfoSDK.exe after installing the Vulkan SDK."
706+
}
707+
708+
$sdkBin = Split-Path -Parent $vulkanInfo.FullName
709+
"VULKAN_VERSION=$sdkVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
710+
"VULKAN_SDK=$sdkRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
711+
$sdkBin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
712+
713+
- name: Install Lavapipe
714+
shell: pwsh
715+
env:
716+
GITHUB_TOKEN: ${{ github.token }}
717+
run: |
718+
$headers = @{
719+
Authorization = "Bearer $env:GITHUB_TOKEN"
720+
'User-Agent' = 'Nabla-CI'
721+
'X-GitHub-Api-Version' = '2022-11-28'
722+
}
723+
724+
$release = Invoke-RestMethod -Uri 'https://api.github.com/repos/jakoch/rasterizers/releases/latest' -Headers $headers
725+
$asset = $release.assets | Where-Object { $_.name -like 'lavapipe-win64-*.zip' } | Select-Object -First 1
726+
if (-not $asset) {
727+
throw "Failed to resolve the latest Lavapipe asset."
728+
}
729+
730+
$archive = Join-Path $env:RUNNER_TEMP $asset.name
731+
$extractRoot = 'C:\lavapipe'
732+
if (Test-Path $extractRoot) {
733+
Remove-Item -Recurse -Force $extractRoot
734+
}
735+
736+
Invoke-WebRequest -Uri $asset.browser_download_url -Headers $headers -OutFile $archive
737+
Expand-Archive -Path $archive -DestinationPath $extractRoot -Force
738+
739+
$lavapipeDll = Get-ChildItem -Path $extractRoot -Recurse -Filter 'vulkan_lvp.dll' -File | Select-Object -First 1
740+
if (-not $lavapipeDll) {
741+
throw "Failed to locate vulkan_lvp.dll after extracting Lavapipe."
742+
}
743+
744+
$lavapipeRoot = Split-Path -Parent (Split-Path -Parent $lavapipeDll.FullName)
745+
$icdPath = Join-Path $lavapipeRoot 'share\vulkan\icd.d\lvp_icd.x86_64.json'
746+
if (-not (Test-Path $icdPath)) {
747+
throw "Failed to locate the Lavapipe ICD manifest."
748+
}
749+
750+
"LAVAPIPE_ROOT=$lavapipeRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
640751
641752
- name: Add lavapipe driver
642-
run: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers" /v "C:\lavapipe\share\vulkan\icd.d\lvp_icd.x86_64.json" /t REG_DWORD /d 0 /f
753+
run: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers" /v "$env:LAVAPIPE_ROOT\share\vulkan\icd.d\lvp_icd.x86_64.json" /t REG_DWORD /d 0 /f
643754

644755
- name: Download Nabla install artifact
645-
uses: actions/download-artifact@v4
756+
uses: actions/download-artifact@v8
646757
with:
647758
name: run-windows-17.13.6-msvc-${{ matrix.config }}-install
648759
path: smoke

.github/workflows/run-nsc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
& "nginx/nginx-1.24.0/nginx.exe" -t -p "nginx/nginx-1.24.0" -c "conf/nginx.conf"
124124

125125
- name: Download NSC Godbolt artifact
126-
uses: actions/download-artifact@v4
126+
uses: actions/download-artifact@v8
127127
with:
128128
run-id: ${{ inputs.run_id }}
129129
pattern: run-windows-*-msvc-${{ inputs.build_config }}-nsc-godbolt-image

0 commit comments

Comments
 (0)