Skip to content

Commit 8484017

Browse files
authored
Update build-nabla.yml, add build checks for examples
1 parent e9bfdbe commit 8484017

File tree

1 file changed

+57
-13
lines changed

1 file changed

+57
-13
lines changed

.github/workflows/build-nabla.yml

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Nabla Workflow
1+
name: Build
22

33
on:
44
push:
@@ -7,14 +7,16 @@ on:
77

88
permissions:
99
contents: read
10+
checks: write
1011

1112
concurrency:
1213
group: push-lock-${{ github.ref }}
1314
cancel-in-progress: true
1415

1516
jobs:
1617
build-windows:
17-
runs-on: windows-2022
18+
name: Nabla (${{ matrix.os }}, ${{ matrix.vendor }}-${{ matrix.tag }}, ${{ matrix.config }})
19+
runs-on: ${{ matrix.os }}
1820

1921
env:
2022
image: ghcr.io/devsh-graphics-programming/docker-nanoserver-msvc-winsdk
@@ -33,6 +35,7 @@ jobs:
3335
vendor: [msvc]
3436
config: [Release, Debug, RelWithDebInfo]
3537
tag: ['17.13.6']
38+
os: [windows-2022]
3639

3740
steps:
3841
- name: Environment Setup
@@ -129,7 +132,30 @@ jobs:
129132
--preset ci-build-dynamic-${{ matrix.vendor }} `
130133
-t run-compiler-explorer --config ${{ matrix.config }}
131134
132-
- name: Container – Build Examples
135+
- name: Container – Install Nabla
136+
run: |
137+
docker exec orphan `
138+
${{ env.entry }} ${{ env.cmd }} -Command cmake --install `
139+
${{ env.binary }} --config ${{ matrix.config }} `
140+
--prefix ${{ env.install }}
141+
142+
- name: API / Examples / Check Run (Create)
143+
id: check-run-create
144+
uses: actions/github-script@v6
145+
with:
146+
github-token: ${{ secrets.GITHUB_TOKEN }}
147+
result-encoding: string
148+
script: |
149+
const response = await github.rest.checks.create({
150+
owner: context.repo.owner,
151+
repo: context.repo.repo,
152+
name: `Examples (${{ matrix.os }}, ${{ matrix.vendor }}-${{ matrix.tag }}, ${{ matrix.config }})`,
153+
head_sha: context.sha,
154+
status: 'in_progress'
155+
});
156+
return response.data.id;
157+
158+
- name: Container – Build & Install Examples
133159
id: build-examples
134160
continue-on-error: true
135161
run: |
@@ -139,21 +165,39 @@ jobs:
139165
-t examples_tests\all --config ${{ matrix.config }} `
140166
-- -k 0
141167
142-
- name: Container – Install Nabla
143-
run: |
144168
docker exec orphan `
145169
${{ env.entry }} ${{ env.cmd }} -Command cmake --install `
146-
${{ env.binary }} --config ${{ matrix.config }} `
170+
${{ env.binary }}\examples_tests --config ${{ matrix.config }} `
147171
--prefix ${{ env.install }}
148172
149-
- name: Container – Install Examples
150-
id: install-examples
151-
continue-on-error: true
173+
- name: API / Examples / Check Run (Conclusion)
174+
id: outcome-examples
152175
run: |
153-
docker exec orphan `
154-
${{ env.entry }} ${{ env.cmd }} -Command cmake --install `
155-
${{ env.binary }}\examples_tests --config ${{ matrix.config }} `
156-
--prefix ${{ env.install }}
176+
$completedAt = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
177+
if ("${{ steps.build-examples.outcome }}" -eq "success") {
178+
"conclusion=success" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
179+
} else {
180+
"conclusion=failure" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
181+
}
182+
"completed_at=$completedAt" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
183+
184+
- name: API / Examples / Check Run (Update)
185+
uses: actions/github-script@v6
186+
with:
187+
github-token: ${{ secrets.GITHUB_TOKEN }}
188+
script: |
189+
await github.rest.checks.update({
190+
owner: context.repo.owner,
191+
repo: context.repo.repo,
192+
check_run_id: ${{ steps.check-run-create.outputs.result }},
193+
status: 'completed',
194+
conclusion: '${{ steps.outcome-examples.outputs.conclusion }}',
195+
completed_at: '${{ steps.outcome-examples.outputs.completed_at }}',
196+
output: {
197+
title: '',
198+
summary: '[View logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see details.'
199+
}
200+
});
157201
158202
- name: Container – Save NSC Image
159203
run: |

0 commit comments

Comments
 (0)