Giter VIP home page Giter VIP logo

setup-vulkan-sdk's Introduction

setup-vulkan-sdk v1.2.0

test setup-vulkan-sdk

This action builds and integrates individual Vulkan SDK components directly from Khronos source repos.

It is meant to offer a more lightweight option for CI/CD than installing the full Vulkan SDK, especially for projects that only need the Vulkan headers and loader available. Building those two SDK components from Khronos source usually takes around a minute and afterwards only uses around ~20MB of disk space (compared to the 600M-1.8GB that a full SDK install would require).

Usage

note: if new to GitHub Actions please see GitHub Help Documentation Quickstart or Creating a workflow file.

Example integration

  -name: Prepare Vulkan SDK
   uses: humbletim/[email protected]
   with:
     vulkan-query-version: 1.3.204.0
     vulkan-components: Vulkan-Headers, Vulkan-Loader
     vulkan-use-cache: true

SDK version numbers are resolved into corresponding Khronos repos and commit points using the official LunarG SDK web API.

As of now the following SDK release numbers are known to be usable across all three primary platforms (linux/mac/windows):

  • 1.2.162.0
  • 1.2.162.1
  • 1.2.170.0
  • 1.2.189.0
  • 1.2.198.1
  • 1.3.204.0

It is also possible to specify latest and the action will attempt to resolve automatically.

NOTE: For production workflows it is recommended to create project-local copies of sdk config.json(s); see Advanced example below.

Including Vulkan SDK command line tools

It is now possible to include Glslang and SPIRV-* command line tools as part of this action.

However, depending on your project's needs, it might make more sense to use unattended installation of an official Vulkan SDK binary releases instead. An alternative action is provided for that humbletim/install-vulkan-sdk (note that using full SDK binary releases consume a lot more runner disk space (600MB+)).

Action Parameters

Advanced integration

  - name: Fetch Vulkan SDK version spec
    shell: bash
    run: |
      curl -o vulkan-sdk-config.json https://vulkan.lunarg.com/sdk/config/1.3.204.0/linux/config.json

  - name: Configure Vulkan SDK using the downloaded spec
    uses: humbletim/[email protected]
    with:
      vulkan-config-file: vulkan-sdk-config.json
      vulkan-components: Vulkan-Headers, Vulkan-Loader
      vulkan-use-cache: true

To "lock in" the Khronos repos and commit points (and avoid any ongoing dependency on LunarG web services), commit a copy of the config.json(s) into your local project and then reference them similarly to above.

Additional integration examples can be found as part of this project's CI test suite: .github/workflows/ci.yml.

References

setup-vulkan-sdk's People

Contributors

humbletim avatar technoir42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

setup-vulkan-sdk's Issues

`VULKAN_SDK` path issue on Windows+CMake

The current way the VULKAN_SDK is resolved on Windows causes a cmake find_package to fail when using this action. It is seemingly resolving a windows path into a linux-style path for my vkfetch project.

So it is resolving into /d/a/vkfetch/vkfetch/VULKAN_SDK rather than D:/a/vkfetch/vkfetch/VULKAN_SDK
https://github.com/Wunkolo/vkfetch/runs/3226556501?check_suite_focus=true#step:3:191

causing find_package( Vulkan) to fail later on, since it cannot resolve these folders:

https://github.com/Wunkolo/vkfetch/runs/3226556501?check_suite_focus=true#step:4:20

This seems to be due to the $PWD command on Windows resolving windows paths in this way.

# export these so that "sourcing" this file directly also works
export VULKAN_SDK_VERSION=$BRANCH
export VULKAN_SDK=$PWD/VULKAN_SDK

$ echo $PWD
/c/Users/wunk

The fix would be that on Windows, the additional -W flag must be used.

$ echo $(pwd -W)
C:/Users/wunk

Process completed with exit code 1 using self hosted runner

Hello,

First of all, thanks for the action that we Vulkan Developers have been longing for :)

Problem:
After running the workflow, I am hit with the following error: Error: Process completed with exit code 1

The preceding code from the workflow it was executing before it gave the error is:

Run humbletim/[email protected]
Run humbletim/vsdevenv-shell@e87fcf2359929[6](https://github.com/nepp95/EppoEngine/actions/runs/6751417874/job/18355538753#step:5:7)06ba32db358baef5ede4[7](https://github.com/nepp95/EppoEngine/actions/runs/6751417874/job/18355538753#step:5:9)37aed
Run if [[ $RUNNER_OS == 'Windows' ]] ; then
  
C:\actions-runner\_work\_actions\humbletim\vsdevenv-shell\e87fcf23599[29](https://github.com/nepp95/EppoEngine/actions/runs/6751417874/job/18355538753#step:5:31)606ba32db358baef5ede4737aed/bin
Run # resolve_vulkan_sdk_environment
  # resolve_vulkan_sdk_environment
  . $GITHUB_ACTION_PATH/action_helpers.sh
  resolve_vulkan_sdk_environment \
    "1.3.261.1" \
    "" \
    "Vulkan-Headers, Vulkan-Loader"
  shell: C:\Program Files\Git\usr\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
mkdir: created directory '/c/actions-runner/_work/EppoEngine/EppoEngine/_vulkan_build'
mkdir: created directory '/c/actions-runner/_work/EppoEngine/EppoEngine/VULKAN_SDK'
Error: Process completed with exit code 1.

Context: Self hosted windows runner running within a docker container based on a self created image (https://hub.docker.com/r/nepp95/runner - tag: windowsv2 which is being uploaded as we speak)

Workflow:

name: EppoEngine CI

on:
  workflow_dispatch:
  push:
    branches: [ master, develop ]
  pull_request:
    branches: [ master, develop ]

jobs:
  build-debug:
    name: "Build"
    runs-on: [ self-hosted, windows ]

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          submodules: recursive

      - name: Setup Premake
        uses: abel0b/[email protected]
        with:
          version: "5.0.0-beta2"
          path: Vendor/Premake/Bin

      - name: Setup MSBuild
        uses: microsoft/[email protected]
      
      - name: Setup VulkanSDK
        uses: humbletim/[email protected]
        with:
          vulkan-query-version: 1.3.261.1
          vulkan-use-cache: true
      
      - name: Run Premake
        working-directory: ${{env.GITHUB_WORKSPACE}}
        run: Vendor/Premake/Bin/Premake5.exe vs2022
      
      - name: Build (Debug)
        run: msbuild /m /p:Configuration=Debug EppoEngine.sln
      
      - name: Build (Release)
        run: msbuild /m /p:Configuration=Release EppoEngine.sln
      
      - name: Build (Dist)
        run: msbuild /m /p:Configuration=Dist EppoEngine.sln

While bash is ofcourse a shell we are able to use within WSL and thus also github's hosted runners, since that enables WSL, I have not yet figured out how to do such thing myself. I am using git bash which comes with git which gets added to path. This might be relevant since before I did that, I encountered the "Bash, command not found" error coming from this action so it inevitably needs bash.
I have tried to trace where this is coming from but can only find an exit code 9 within the function being called.

Kind regards,
Niels
(New to self hosted runners, which is probably also the cause of this problem)

Vulkan-Headers failed to checkout 'test-SDK-integration'

Hi, since yesterday I'm getting the following error in my GitHub Action workflow:

  Checking Build System
  Creating directories for 'Vulkan-Headers'
  Building Custom Rule D:/a/_actions/humbletim/setup-vulkan-sdk/v1.2.0/CMakeLists.txt
  Performing download step (git clone) for 'Vulkan-Headers'
  Cloning into 'Vulkan-Headers'...
  fatal: invalid reference: test-SDK-integration
  CMake Error at D:/a/TRAP/TRAP/_vulkan_build/Vulkan-Headers-prefix/tmp/Vulkan-Headers-gitclone.cmake:49 (message):
    Failed to checkout tag: 'test-SDK-integration'

Happens when using:

Run humbletim/[email protected]
  with:
    vulkan-query-version: latest
    vulkan-components: Vulkan-Headers, Vulkan-Loader
    vulkan-use-cache: true

Runner information:

Current runner version: '2.304.0'
Operating System
  Microsoft Windows Server 2022
  10.0.20348
  Datacenter
Runner Image
  Image: windows-2022
  Version: 20230502.2
  Included Software: https://github.com/actions/runner-images/blob/win22/20230502.2/images/win/Windows2022-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20230502.2
Runner Image Provisioner
  2.0.171.1

Here is a link to the full run: https://github.com/GamesTrap/TRAP/actions/runs/4899434642/jobs/8754400607

Action fails with "parse error: Invalid numeric literal"

This action has been working fine for me until yesterday, but now I can't get it to succeed anymore. It fails with the following error:
2022-10-26T07:23:34.7120775Z parse error: Invalid numeric literal at line 1, column 7

Here is the entire log:

2022-10-26T07:23:27.1469329Z Requested labels: ubuntu-latest
2022-10-26T07:23:27.1469369Z Job defined at: Silverlan/test_github_action_vulkan/.github/workflows/pragma-linux-ci.yml@refs/heads/main
2022-10-26T07:23:27.1469394Z Waiting for a runner to pick up this job...
2022-10-26T07:23:27.2779776Z Job is waiting for a hosted runner to come online.
2022-10-26T07:23:30.8678961Z Job is about to start running on the hosted runner: Hosted Agent (hosted)
2022-10-26T07:23:32.8176623Z Current runner version: '2.298.2'
2022-10-26T07:23:32.8202076Z ##[group]Operating System
2022-10-26T07:23:32.8202632Z Ubuntu
2022-10-26T07:23:32.8202880Z 20.04.5
2022-10-26T07:23:32.8203258Z LTS
2022-10-26T07:23:32.8203559Z ##[endgroup]
2022-10-26T07:23:32.8203836Z ##[group]Runner Image
2022-10-26T07:23:32.8204212Z Image: ubuntu-20.04
2022-10-26T07:23:32.8204575Z Version: 20221018.2
2022-10-26T07:23:32.8205092Z Included Software: https://github.com/actions/runner-images/blob/ubuntu20/20221018.2/images/linux/Ubuntu2004-Readme.md
2022-10-26T07:23:32.8205691Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu20%2F20221018.2
2022-10-26T07:23:32.8206142Z ##[endgroup]
2022-10-26T07:23:32.8206486Z ##[group]Runner Image Provisioner
2022-10-26T07:23:32.8206812Z 2.0.91.1
2022-10-26T07:23:32.8207109Z ##[endgroup]
2022-10-26T07:23:32.8208056Z ##[group]GITHUB_TOKEN Permissions
2022-10-26T07:23:32.8208714Z Actions: write
2022-10-26T07:23:32.8209025Z Checks: write
2022-10-26T07:23:32.8209552Z Contents: write
2022-10-26T07:23:32.8209900Z Deployments: write
2022-10-26T07:23:32.8210219Z Discussions: write
2022-10-26T07:23:32.8210575Z Issues: write
2022-10-26T07:23:32.8210896Z Metadata: read
2022-10-26T07:23:32.8211166Z Packages: write
2022-10-26T07:23:32.8211483Z Pages: write
2022-10-26T07:23:32.8211843Z PullRequests: write
2022-10-26T07:23:32.8212159Z RepositoryProjects: write
2022-10-26T07:23:32.8212535Z SecurityEvents: write
2022-10-26T07:23:32.8212867Z Statuses: write
2022-10-26T07:23:32.8213138Z ##[endgroup]
2022-10-26T07:23:32.8216779Z Secret source: Actions
2022-10-26T07:23:32.8217312Z Prepare workflow directory
2022-10-26T07:23:32.9044582Z Prepare all required actions
2022-10-26T07:23:32.9227282Z Getting action download info
2022-10-26T07:23:33.0966280Z Download action repository 'humbletim/[email protected]' (SHA:72eed4b9dbeac5de168f83da8e30b1d0f8ac7f14)
2022-10-26T07:23:33.5657948Z Getting action download info
2022-10-26T07:23:33.8163778Z Download action repository 'humbletim/vsdevenv-shell@e87fcf2359929606ba32db358baef5ede4737aed' (SHA:e87fcf2359929606ba32db358baef5ede4737aed)
2022-10-26T07:23:34.0446020Z Download action repository 'actions/cache@v2' (SHA:937d24475381cd9c75ae6db12cb4e79714b926ed)
2022-10-26T07:23:34.4023858Z ##[group]Run humbletim/[email protected]
2022-10-26T07:23:34.4024196Z with:
2022-10-26T07:23:34.4024422Z   vulkan-query-version: 1.3.211.0
2022-10-26T07:23:34.4024745Z   vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang
2022-10-26T07:23:34.4025043Z   vulkan-use-cache: true
2022-10-26T07:23:34.4025257Z ##[endgroup]
2022-10-26T07:23:34.4253117Z ##[group]Run humbletim/vsdevenv-shell@e87fcf2359929606ba32db358baef5ede4737aed
2022-10-26T07:23:34.4253453Z ##[endgroup]
2022-10-26T07:23:34.4303009Z ##[group]Run if [[ $RUNNER_OS == 'Windows' ]] ; then
2022-10-26T07:23:34.4303424Z �[36;1mif [[ $RUNNER_OS == 'Windows' ]] ; then�[0m
2022-10-26T07:23:34.4303718Z �[36;1m  echo $GITHUB_ACTION_PATH/bin | tee -a $GITHUB_PATH�[0m
2022-10-26T07:23:34.4303996Z �[36;1melse�[0m
2022-10-26T07:23:34.4304366Z �[36;1m  echo "NOTE: emulating vsdevenv-shell integration (since RUNNER_OS is $RUNNER_OS, not Windows)"�[0m
2022-10-26T07:23:34.4304790Z �[36;1m  echo $GITHUB_ACTION_PATH/bin | tee -a $GITHUB_PATH�[0m
2022-10-26T07:23:34.4305097Z �[36;1m  cat<<-'EOF' > $GITHUB_ACTION_PATH/bin/vsdevenv�[0m
2022-10-26T07:23:34.4305356Z �[36;1m#!/bin/bash�[0m
2022-10-26T07:23:34.4305566Z �[36;1mset -e�[0m
2022-10-26T07:23:34.4305759Z �[36;1mshift # x86�[0m
2022-10-26T07:23:34.4305974Z �[36;1msubshell=$1�[0m
2022-10-26T07:23:34.4306198Z �[36;1mshift # subshell�[0m
2022-10-26T07:23:34.4306416Z �[36;1mcase $subshell in�[0m
2022-10-26T07:23:34.4306700Z �[36;1m  bash) bash --noprofile --norc -e -o pipefail "$1" ;;�[0m
2022-10-26T07:23:34.4307243Z �[36;1m  pwsh|powershell) pwsh -command "\$ErrorActionPreference = 'stop' ; get-content '$1' | Invoke-Expression ; if ((Test-Path -LiteralPath variable:\\LASTEXITCODE)) { exit \$LASTEXITCODE }" ;;�[0m
2022-10-26T07:23:34.4307768Z �[36;1m  *) echo "skipping subshell=$subshell on $RUNNER_OS" ; exit 0 ;;�[0m
2022-10-26T07:23:34.4308267Z �[36;1mesac�[0m
2022-10-26T07:23:34.4308467Z �[36;1mEOF�[0m
2022-10-26T07:23:34.4308725Z �[36;1m  chmod a+x $GITHUB_ACTION_PATH/bin/vsdevenv�[0m
2022-10-26T07:23:34.4309023Z �[36;1m  cat $GITHUB_ACTION_PATH/bin/vsdevenv�[0m
2022-10-26T07:23:34.4309305Z �[36;1mfi�[0m
2022-10-26T07:23:34.4368488Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2022-10-26T07:23:34.4368804Z ##[endgroup]
2022-10-26T07:23:34.4632588Z NOTE: emulating vsdevenv-shell integration (since RUNNER_OS is Linux, not Windows)
2022-10-26T07:23:34.4633933Z /home/runner/work/_actions/humbletim/vsdevenv-shell/e87fcf2359929606ba32db358baef5ede4737aed/bin
2022-10-26T07:23:34.4663817Z #!/bin/bash
2022-10-26T07:23:34.4666151Z set -e
2022-10-26T07:23:34.4675042Z shift # x86
2022-10-26T07:23:34.4676653Z subshell=$1
2022-10-26T07:23:34.4676924Z shift # subshell
2022-10-26T07:23:34.4677127Z case $subshell in
2022-10-26T07:23:34.4677569Z   bash) bash --noprofile --norc -e -o pipefail "$1" ;;
2022-10-26T07:23:34.4678337Z   pwsh|powershell) pwsh -command "\$ErrorActionPreference = 'stop' ; get-content '$1' | Invoke-Expression ; if ((Test-Path -LiteralPath variable:\\LASTEXITCODE)) { exit \$LASTEXITCODE }" ;;
2022-10-26T07:23:34.4678854Z   *) echo "skipping subshell=$subshell on $RUNNER_OS" ; exit 0 ;;
2022-10-26T07:23:34.4679118Z esac
2022-10-26T07:23:34.4916168Z ##[group]Run # resolve_vulkan_sdk_environment
2022-10-26T07:23:34.4916509Z �[36;1m# resolve_vulkan_sdk_environment�[0m
2022-10-26T07:23:34.4916799Z �[36;1m. $GITHUB_ACTION_PATH/action_helpers.sh�[0m
2022-10-26T07:23:34.4917072Z �[36;1mresolve_vulkan_sdk_environment \�[0m
2022-10-26T07:23:34.4917315Z �[36;1m  "1.3.211.0" \�[0m
2022-10-26T07:23:34.4917514Z �[36;1m  "" \�[0m
2022-10-26T07:23:34.4917761Z �[36;1m  "Vulkan-Headers, Vulkan-Loader, Glslang"�[0m
2022-10-26T07:23:34.4972700Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2022-10-26T07:23:34.4972981Z ##[endgroup]
2022-10-26T07:23:34.5117252Z mkdir: created directory '/home/runner/work/test_github_action_vulkan/test_github_action_vulkan/_vulkan_build'
2022-10-26T07:23:34.5130760Z mkdir: created directory '/home/runner/work/test_github_action_vulkan/test_github_action_vulkan/VULKAN_SDK'
2022-10-26T07:23:34.7120775Z parse error: Invalid numeric literal at line 1, column 7
2022-10-26T07:23:34.7144907Z ##[error]Process completed with exit code 4.
2022-10-26T07:23:34.7273563Z Post job cleanup.
2022-10-26T07:23:34.7391164Z Cleaning up orphan processes

My test workflow is very basic and just looks like this:

name: Build Linux
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

concurrency:
  group: environment-lin-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build:
    name: Build - ${{ matrix.config.os }}
    runs-on: ${{ matrix.config.os }}
    strategy:
      fail-fast: false
      matrix:
        config:
          - os: ubuntu-latest
            name: "Ubuntu GCC-11"
            artifact: "ubuntu_gcc.7z"
            archiver: "7z a"
            generators: "Unix Makefiles"
            build_dir: 'build'
    steps:
      - name: Prepare Vulkan SDK
        uses: humbletim/[email protected]
        with:
          vulkan-query-version: 1.3.211.0
          vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang
          vulkan-use-cache: true

https://github.com/Silverlan/test_github_action_vulkan/blob/main/.github/workflows/pragma-linux-ci.yml

Setup Vulkan SDK action not working as of today

Hello, I've been using this action in my repository and it seems to have started failing, making all builds and PRs fail.
I have tried deleting the Github Actions cache and rerunning the jobs but they're still failing.

All our workflows use the action like this:

    - name: Setup Vulkan SDK
      uses: humbletim/[email protected]
      with:
        vulkan-query-version: latest
        vulkan-use-cache: true
        vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang

Our relevant Github workflows can be found here: https://github.com/wheremyfoodat/Panda3DS/tree/master/.github/workflows
I've also attached the log generated by the vulkan setup action here:
setup_vulkan_log.txt

If you'd prefer to see the full CI log for this particular run then you can find it here: https://github.com/wheremyfoodat/Panda3DS/actions/runs/6631468473/job/18015376439?pr=328

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.