Skip to content

Refactor viewports #172

Refactor viewports

Refactor viewports #172

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: "ARM64EC Vulkan Debug"
on:
workflow_dispatch:
push:
branches: [ "master" ]
paths:
- '**/*.vcxproj'
- '**/*.h'
- '**/*.hpp'
- '**/*.c'
- '**/*.cpp'
- '**/*.inl'
- '**/*.hlsli'
- '**/*.hlsl.h'
pull_request:
branches: [ "master" ]
paths:
- '**/*.vcxproj'
- '**/*.h'
- '**/*.hpp'
- '**/*.c'
- '**/*.cpp'
- '**/*.inl'
- '**/*.hlsli'
- '**/*.hlsl.h'
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: vgframework.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Debug
# Platform to build.
BUILD_PLATFORM: '"ARM64EC Vulkan"'
permissions:
contents: read
jobs:
build_arm64ec_vulkan_debug:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.11.2, 18.0.0)'
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.290.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}
- name: Success Notification
if: ${{ success() }}
run: |
$DISCORD_BUILD_WEBHOOK_URL = "${{ secrets.DISCORD_BUILD_WEBHOOK_URL }}"
$commitMessage = @"
${{ github.event.head_commit.message }}
"@
$jobName = "${{ github.job }}"
$runId = "${{ github.run_id }}"
$repo = "${{ github.repository }}"
$serverUrl = "${{ github.server_url }}"
$jobsApiUrl = "https://api.github.com/repos/$repo/actions/runs/$runId/jobs"
$jobId = (curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" $jobsApiUrl | ConvertFrom-Json).jobs | Where-Object { $_.name -eq $jobName } | Select-Object -ExpandProperty id
$jobUrl = "$serverUrl/$repo/actions/runs/$runId/job/$jobId"
$commitSha = "${{ github.sha }}"
$shortCommitSha = $commitSha.Substring(0, 7)
# Split the commit message on double newlines (\r?\n\r?\n) to separate the summary and description. Clean and escape strings to make them JSON-safe
$splitMessage = $commitMessage -split '\r?\n\r?\n', 2
$summary = $splitMessage[0]
$description = if ($splitMessage.Length -gt 1) { $splitMessage[1] } else { "" }
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build succeeded ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "$title",
"description": "$escapedSummary",
"color": 38912,
"thumbnail": {
"url": "https://github.com/vimontgames/vgframework/blob/master/doc/img/buildsuccess.png?raw=true"
},
"author": {
"name": "$($env:GITHUB_ACTOR)",
"url": "https://github.com/$($env:GITHUB_ACTOR)",
"icon_url": "https://avatars.githubusercontent.com/u/$($env:GITHUB_ACTOR_ID)?v=4"
},
"url": "$jobUrl"
}
]
}
"@
$RESPONSE = curl -H "Content-Type: application/json" -X POST -d $jsonPayload $DISCORD_BUILD_WEBHOOK_URL
Write-Output "Webhook server response: $RESPONSE"
- name: Failure Notification
if: ${{ failure() }}
run: |
$DISCORD_BUILD_WEBHOOK_URL = "${{ secrets.DISCORD_BUILD_WEBHOOK_URL }}"
$commitMessage = @"
${{ github.event.head_commit.message }}
"@
$jobName = "${{ github.job }}"
$runId = "${{ github.run_id }}"
$repo = "${{ github.repository }}"
$serverUrl = "${{ github.server_url }}"
$jobsApiUrl = "https://api.github.com/repos/$repo/actions/runs/$runId/jobs"
$jobId = (curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" $jobsApiUrl | ConvertFrom-Json).jobs | Where-Object { $_.name -eq $jobName } | Select-Object -ExpandProperty id
$jobUrl = "$serverUrl/$repo/actions/runs/$runId/job/$jobId"
$commitSha = "${{ github.sha }}"
$shortCommitSha = $commitSha.Substring(0, 7)
# Split the commit message on double newlines (\r?\n\r?\n) to separate the summary and description. Clean and escape strings to make them JSON-safe
$splitMessage = $commitMessage -split '\r?\n\r?\n', 2
$summary = $splitMessage[0]
$description = if ($splitMessage.Length -gt 1) { $splitMessage[1] } else { "" }
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build failed ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "$title",
"description": "$escapedSummary",
"color": 16515049,
"thumbnail": {
"url": "https://github.com/vimontgames/vgframework/blob/master/doc/img/buildfailed.png?raw=true"
},
"author": {
"name": "$($env:GITHUB_ACTOR)",
"url": "https://github.com/$($env:GITHUB_ACTOR)",
"icon_url": "https://avatars.githubusercontent.com/u/$($env:GITHUB_ACTOR_ID)?v=4"
},
"url": "$jobUrl"
}
]
}
"@
$RESPONSE = curl -H "Content-Type: application/json" -X POST -d $jsonPayload $DISCORD_BUILD_WEBHOOK_URL
Write-Output "Webhook server response: $RESPONSE"