Skip to content

Commit f82b405

Browse files
committed
Merge branch 'master' into improve-workgroup-scan-2
2 parents 0a5dc30 + 9178ec3 commit f82b405

File tree

5 files changed

+103
-11
lines changed

5 files changed

+103
-11
lines changed

.github/workflows/build-nabla.yml

Lines changed: 77 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
pull_request:
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
concurrency:
912
group: push-lock-${{ github.ref }}
1013
cancel-in-progress: true
@@ -54,10 +57,11 @@ jobs:
5457
shell: pwsh
5558
run: |
5659
$prefix = "run-windows-${{ matrix.tag }}-${{ matrix.vendor }}-${{ matrix.config }}"
57-
$repo = $env:GITHUB_REPOSITORY
58-
$tag = "nsc-godbolt-build-${{ matrix.vendor }}-${{ matrix.config }}-${{ matrix.tag }}"
59-
$nscTargetTaggedImage = "ghcr.io/${repo}:${tag}".ToLower()
60-
$nscTargetTaggedImageLatest = "ghcr.io/${repo}:nsc-godbolt-latest".ToLower()
60+
$owner = "${{ github.repository_owner }}"
61+
$package = "nabla-shader-compiler-godbolt"
62+
$tag = "build-${{ matrix.vendor }}-${{ matrix.config }}-${{ matrix.tag }}"
63+
$nscTargetTaggedImage = "ghcr.io/${owner}/${package}:${tag}".ToLower()
64+
$nscTargetTaggedImageLatest = "ghcr.io/${owner}/${package}:latest".ToLower()
6165
6266
$shouldPushImage = (
6367
"${{ github.ref }}" -eq "refs/heads/master" -and
@@ -178,4 +182,72 @@ jobs:
178182
- name: Push images to GHCR
179183
if: steps.set-prefix.outputs.shouldPushImage == 'True'
180184
run: |
181-
docker push ${{ steps.set-prefix.outputs.nscTargetTaggedImageLatest }}
185+
docker push ${{ steps.set-prefix.outputs.nscTargetTaggedImageLatest }}
186+
187+
update-badges:
188+
name: Update Build & Image Badges
189+
if: ${{ always() && github.ref == 'refs/heads/master' }}
190+
needs: build-windows
191+
runs-on: windows-2022
192+
permissions:
193+
contents: write
194+
195+
steps:
196+
- name: Checkout
197+
uses: actions/checkout@v4
198+
199+
- name: Create Build Badge
200+
run: |
201+
$jobStatus = "${{ needs.build-windows.result }}"
202+
$buildMsg = if ($jobStatus -eq "success") { "passing" } else { "failing" }
203+
$buildColor = if ($jobStatus -eq "success") { "brightgreen" } else { "red" }
204+
205+
$buildBadge = @{
206+
schemaVersion = 1
207+
label = "build"
208+
message = $buildMsg
209+
color = $buildColor
210+
} | ConvertTo-Json -Depth 2
211+
212+
$buildPath = ".badge-public/nabla"
213+
New-Item -ItemType Directory -Path $buildPath -Force | Out-Null
214+
$buildBadge | Set-Content -Path "$buildPath/build.json" -Encoding utf8
215+
216+
- name: Create Image Size Badge
217+
run: |
218+
$owner = "${{ github.repository_owner }}"
219+
$package = "nabla-shader-compiler-godbolt"
220+
$image = "ghcr.io/${owner}/${package}:latest".ToLower()
221+
$manifest = docker manifest inspect $image | ConvertFrom-Json
222+
223+
if ($manifest.manifests) {
224+
$totalSize = ($manifest.manifests | Measure-Object -Property size -Sum).Sum
225+
} elseif ($manifest.layers) {
226+
$totalSize = ($manifest.layers | Measure-Object -Property size -Sum).Sum
227+
} else {
228+
Write-Error "No valid size information found in manifest."
229+
exit 1
230+
}
231+
232+
$sizeMB = [Math]::Round($totalSize / 1MB, 2)
233+
$size = "$sizeMB MB"
234+
235+
$imageBadge = @{
236+
schemaVersion = 1
237+
label = $image
238+
message = $size
239+
color = "blue"
240+
} | ConvertTo-Json -Depth 2
241+
242+
$imagePath = ".badge-public/packages/nabla-shader-compiler-nsc"
243+
New-Item -ItemType Directory -Path $imagePath -Force | Out-Null
244+
$imageBadge | Set-Content -Path "$imagePath/image-badge.json" -Encoding utf8
245+
246+
- name: Deploy Badges
247+
uses: peaceiris/actions-gh-pages@v3
248+
with:
249+
github_token: ${{ secrets.GITHUB_TOKEN }}
250+
publish_branch: badges
251+
publish_dir: .badge-public
252+
keep_files: true
253+
commit_message: "[CI] badges update"

.github/workflows/run-nsc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ jobs:
121121
- name: Generate and run Docker Compose with matched image
122122
run: |
123123
$imageName = docker image ls --format "{{.Repository}}:{{.Tag}}" |
124-
Where-Object { $_ -like "ghcr.io/devsh-graphics-programming/nabla:nsc-*" } |
124+
Where-Object { $_ -like "ghcr.io/devsh-graphics-programming/nabla-shader-compiler-godbolt:build-*" } |
125125
Select-Object -First 1
126126
127127
if (-not $imageName) {
128-
Write-Error "Could not find image with tag matching ghcr.io/devsh-graphics-programming/nabla:nsc-*"
128+
Write-Error "Could not find image with tag matching ghcr.io/devsh-graphics-programming/nabla-shader-compiler-godbolt:build-*"
129129
exit 1
130130
}
131131

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
<div align="center">
33
<img alt="Click to see the source" height="200" src="nabla-glow.svg" width="200" />
44
</div>
5-
<div align="center">
6-
<img alt="Click to see the source" height="200" src="https://github.com/user-attachments/assets/81f15d9b-0b9b-4ecc-981a-6e43e3b4c49b" width="700" />
7-
</div>
5+
6+
<p align="center">
7+
<a href="https://github.com/Devsh-Graphics-Programming/Nabla/actions">
8+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Devsh-Graphics-Programming/Nabla/badges/nabla/build.json" alt="Build Status" /></a>
9+
<a href="https://opensource.org/licenses/Apache-2.0">
10+
<img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="License: Apache 2.0" /></a>
11+
<a href="https://discord.gg/krsBcABm7u">
12+
<img src="https://img.shields.io/discord/308323056592486420?label=discord&logo=discord&logoColor=white&color=7289DA" alt="Join our Discord" /></a>
13+
</p>
814

915
# Table of Contents
1016

compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
nsc:
33
container_name: nsc-godbolt
4-
image: ghcr.io/devsh-graphics-programming/nabla:nsc-godbolt-latest
4+
image: ghcr.io/devsh-graphics-programming/nabla-shader-compiler-godbolt:latest
55
isolation: process
66
ports:
77
- "80:10240"

tools/nsc/docker/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44

55
https://github.com/user-attachments/assets/8d409477-92e4-4238-b5e5-637cfbdf7263
66

7+
<p align="center">
8+
<a href="https://github.com/Devsh-Graphics-Programming/Nabla/actions">
9+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Devsh-Graphics-Programming/Nabla/badges/packages/nabla-shader-compiler-nsc/image-badge.json" alt="Image Status" /></a>
10+
<a href="https://github.com/Devsh-Graphics-Programming/Nabla/actions">
11+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Devsh-Graphics-Programming/Nabla/badges/nabla/build.json" alt="Build Status" /></a>
12+
<a href="https://opensource.org/licenses/Apache-2.0">
13+
<img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="License: Apache 2.0" /></a>
14+
<a href="https://discord.gg/krsBcABm7u">
15+
<img src="https://img.shields.io/discord/308323056592486420?label=discord&logo=discord&logoColor=white&color=7289DA" alt="Join our Discord" /></a>
16+
</p>
17+
718
## Requirements
819

920
- Configured [***Docker***](https://docs.docker.com/desktop/setup/install/windows-install/) for Windows Containers
@@ -12,6 +23,9 @@ https://github.com/user-attachments/assets/8d409477-92e4-4238-b5e5-637cfbdf7263
1223
> [!TIP]
1324
> type `cmd /ver` to see your build version
1425
26+
> [!WARNING]
27+
> You cannot run it on Windows Home Edition as it doesn't have `Containers` feature, visit Microsoft [docs](<https://learn.microsoft.com/en-gb/virtualization/windowscontainers/quick-start/set-up-environment?tabs=dockerce>) for more details
28+
1529
> [!CAUTION]
1630
> Hyper-V is **NOT** supported, you must run NSC Godbolt container as process
1731

0 commit comments

Comments
 (0)