Add 'CUDA' awareness #166
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Toolchain CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '.editorconfig' | |
- '.vscode/**' | |
- '*.md' | |
workflow_dispatch: | |
jobs: | |
analyze: | |
name: Run 'cmake-lint' | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install 'cmakelang[YAML]' | |
shell: pwsh | |
run: | | |
& pip install cmakelang[YAML] | |
- name: CMake lint | |
shell: pwsh | |
run: | | |
& ./analyze.ps1 | |
build: | |
name: Build Examples | |
strategy: | |
max-parallel: 8 | |
fail-fast: false | |
matrix: | |
configuration: [ Debug, Release ] | |
buildPreset: [ windows-msvc-x64, windows-msvc-spectre-x64, windows-msvc-amd64, windows-msvc-x86, windows-msvc-arm64, windows-clang-x64, windows-clang-amd64, windows-clangcl-x64, windows-clangcl-amd64 ] | |
include: | |
- buildPreset: windows-msvc-x64 | |
cuda: true | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Ninja | |
shell: pwsh | |
run: | | |
choco install ninja | |
- name: Install NVIDIA Cuda Toolkit | |
if: ${{ matrix.cuda }} | |
shell: pwsh | |
run: | | |
choco install cuda | |
# The installation sets the CUDA_PATH environment variable - use 'Update-SessionEnvironment' to pull it into | |
# the current process' environment block, then add it to the '$env:GITHUB_ENV' file for subsequent steps. | |
Import-Module "$env:ChocolateyInstall/helpers/chocolateyInstaller.psm1" | |
Update-SessionEnvironment | |
"CUDA_PATH=$env:CUDA_PATH" >> $env:GITHUB_ENV | |
- name: CMake Configure ${{ matrix.buildPreset }} | |
shell: pwsh | |
run: | | |
Set-Location ./example | |
cmake --preset ${{ matrix.buildPreset }} | |
- name: CMake Build ${{ matrix.buildPreset }} | |
shell: pwsh | |
run: | | |
Set-Location ./example | |
cmake --build --preset ${{ matrix.buildPreset }} --config ${{ matrix.configuration }} | |
- name: Upload output artifact | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: __output_${{ matrix.buildPreset }}_${{ matrix.configuration }} | |
path: | | |
example/__output/${{ matrix.buildPreset }} | |
!example/__output/${{ matrix.buildPreset }}/**/*.ilk | |
!example/__output/${{ matrix.buildPreset }}/**/*.obj | |
!example/__output/${{ matrix.buildPreset }}/**/*.pch |