humbletim / setup-vulkan-sdk

github action that provisions the Vulkan SDK and configures VULKAN_SDK environment variable
MIT License
48 stars 12 forks source link

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/setup-vulkan-sdk@v1.2.0
   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):

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/setup-vulkan-sdk@v1.2.0
    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