Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 81 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
name: test install-vulkan-sdk

on:
push:
workflow_dispatch:
inputs:
extra_tests:
description: 'Enable additional CI tests'
required: false
default: false
versions:
description: 'Vulkan SDK Versions'
required: true
default: '[ "1.3.204.1" ]'
oses:
description: 'Matrix OSes'
required: true
default: '[ "ubuntu-latest", "windows-latest", "macos-12" ]'
quiet:
description: 'silence annotation'
required: false
default: false
inputs:
extra_tests:
description: "Enable additional CI tests"
required: false
default: false
versions:
description: "Vulkan SDK Versions"
required: true
default: '[ "1.4.304.0" ]'
oses:
description: "Matrix OSes"
required: true
default: '[ "ubuntu-latest", "ubuntu-24.04-arm", "ubuntu-22.04-arm", "windows-latest", "macos-15", "macos-12" ]'
quiet:
description: "Silence annotation"
required: false
default: false
use_arm_artifact:
description: "Use prebuilt ARM artifacts"
type: boolean
default: true

jobs:
setup-all-matrix:
if: ${{ github.event.inputs.extra_tests == 'true' || github.event.inputs.extra_tests == 'matrix' }}
Expand All @@ -28,12 +34,37 @@ jobs:
version: ${{ fromJSON(github.event.inputs.versions) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Check for ARM Artifact
if: ${{ matrix.os contains 'arm' && inputs.use_arm_artifact }}
id: check-arm
uses: actions/github-script@v7
with:
script: |
const { data } = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
name: `vulkansdk-linux-arm64-${process.env.RUNNER_OS}-${process.env.VERSION}`
});
return data.artifacts.length > 0 ? 'exists' : 'not-found';

- name: Download ARM Artifact
if: ${{ steps.check-arm.outputs.result == 'exists' }}
uses: actions/download-artifact@v4
with:
name: vulkansdk-linux-arm64-${{ matrix.os }}-${{ env.VULKAN_SDK_VERSION }}

- name: Build ARM SDK
if: ${{ steps.check-arm.outputs.result == 'not-found' && matrix.os contains 'arm' }}
uses: ./.github/workflows/ubuntu-arm.yml
with:
version: ${{ env.VULKAN_SDK_VERSION }}

- uses: ./
with:
version: ${{ matrix.version }}
cache: true
quiet: ${{ github.event.inputs.quiet }}
use_arm_artifact: ${{ inputs.use_arm_artifact }}

- name: Test Vulkan SDK Install
shell: bash
run: |
Expand Down Expand Up @@ -80,6 +111,36 @@ jobs:
test-prebuilt-linux:
if: ${{ contains(github.event.inputs.extra_tests, 'prebuilt-linux') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
version: ${{ fromJSON(github.event.inputs.versions)[0] }}
cache: false
- name: Smoke test Vulkan SDK
shell: bash
run: |
echo VULKAN_SDK=$VULKAN_SDK
echo VULKAN_SDK_VERSION=$VULKAN_SDK_VERSION
glslangValidator --version
spirv-cfg --version
spirv-cross --help 2>&1 | head -1
glslc --version
du -hsc $VULKAN_SDK/*
find $VULKAN_SDK -size +50M | xargs ls -lrth
- name: Test compiling against Vulkan SDK Install
shell: bash
run: |
echo "Vulkan SDK Version=='$VULKAN_SDK_VERSION'"
echo "VULKAN_SDK=='$VULKAN_SDK'"
test -n "$VULKAN_SDK_VERSION"
cmake -B tests/build -S tests -DCMAKE_BUILD_TYPE=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=.
cmake --build tests/build --config release
./tests/build/test_vulkan

test-prebuilt-linux-arm:
if: ${{ contains(github.event.inputs.extra_tests, 'prebuilt-linux') }}
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down Expand Up @@ -146,4 +207,4 @@ jobs:
test -n "$VULKAN_SDK_VERSION"
cmake -B tests/build -S tests -DCMAKE_BUILD_TYPE=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=.
cmake --build tests/build --config release
./tests/build/test_vulkan
./tests/build/test_vulkan
89 changes: 89 additions & 0 deletions .github/workflows/ubuntu-arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build-Vulkan-SDK-ARM
on:
push:
workflow_dispatch:
inputs:
version:
description: 'Vulkan SDK version (e.g., 1.4.304.0)'
required: false
default: 'latest'

jobs:
build-linux-arm:
name: Build Vulkan-SDK-ARM for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-24.04-arm, ubuntu-22.04-arm ]
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set version variable
id: vars
run: |
if [[ "${{ github.event.inputs.version }}" == "latest" || -z "${{ github.event.inputs.version }}" ]]; then
echo "SDK_URL=https://sdk.lunarg.com/sdk/download/latest/linux/vulkan-sdk.tar.xz" >> $GITHUB_ENV
echo "Using default SDK version: latest"
else
echo "SDK_URL=https://sdk.lunarg.com/sdk/download/${{ github.event.inputs.version }}/linux/vulkansdk-linux-arm64-${{ github.event.inputs.version }}.tar.xz" >> $GITHUB_ENV
echo "Using specified SDK version: ${{ github.event.inputs.version }}"
fi

- name: Update APT
run: sudo apt update

- name: Install Host Dependencies
run: |
if [[ "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then
sudo apt install cmake ninja-build gcc-12 g++-12 bison ocaml-core xz-utils pkg-config python3-pip -y
elif [[ "${{ matrix.os }}" == "ubuntu-24.04-arm" ]]; then
sudo apt install cmake ninja-build gcc-14 g++-14 bison ocaml-core xz-utils pkg-config python3-pip -y
fi

- name: Install Python
run: pip3 install setuptools wheel

- name: Install Target Dependencies
run: |
sudo apt install libglm-dev libxcb-dri3-0 libxcb-present0 libpciaccess0 \
libpng-dev libxcb-keysyms1-dev libxcb-dri3-dev libx11-dev \
libwayland-dev libxrandr-dev libxcb-randr0-dev libxcb-ewmh-dev \
libx11-xcb-dev liblz4-dev libzstd-dev \
libxml2-dev wayland-protocols -y --no-install-recommends

- name: Download SDK
run: curl -L -o vulkan-sdk.tar.xz "$SDK_URL"

- name: Extract SDK and Determine SDK Directory
run: |
tar -xJf vulkan-sdk.tar.xz
SDK_DIR=$(find . -maxdepth 1 -type d -name '1.*' | head -n 1)
echo "SDK_DIR=${SDK_DIR}" >> $GITHUB_ENV
echo "SDK_VERSION=$(basename ${SDK_DIR})" >> $GITHUB_ENV

- name: Remove x86_64 directory
run: |
cd "${{ env.SDK_DIR }}"
rm -rf x86_64

- name: Build SDK
run: |
cd "${{ env.SDK_DIR }}"
if [[ "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then
CC=/usr/bin/aarch64-linux-gnu-gcc-12 CXX=/usr/bin/aarch64-linux-gnu-g++-12 ./vulkansdk --maxjobs vulkan-loader vulkan-validationlayers vulkan-extensionlayer
elif [[ "${{ matrix.os }}" == "ubuntu-24.04-arm" ]]; then
CC=/usr/bin/aarch64-linux-gnu-gcc-14 CXX=/usr/bin/aarch64-linux-gnu-g++-14 ./vulkansdk --maxjobs vulkan-loader vulkan-validationlayers vulkan-extensionlayer
fi

# When an Artifact is uploaded, all the files are assembled into an immutable Zip archive. There is currently no way to download artifacts in a format other than a Zip or to download individual artifact contents.
- name: Rename SDK Directory for Artifact
run: |
mv "${{ env.SDK_DIR }}" "vulkansdk-linux-arm64-${{ matrix.os }}-${{ env.SDK_VERSION }}"

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: vulkansdk-linux-arm64-${{ matrix.os }}-${{ env.SDK_VERSION }}
path: vulkansdk-linux-arm64-${{ matrix.os }}-${{ env.SDK_VERSION }}
retention-days: 30
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 humbletim
Copyright (c) 2025 humbletim

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This action automatically downloads and installs the Vulkan SDK development envi

```yaml
-name: Install Vulkan SDK
uses: humbletim/install-vulkan-sdk@v1.1.1
uses: humbletim/install-vulkan-sdk@v2
with:
version: 1.3.204.1
cache: true
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
description: 'silence GitHub Annotation notice displayed if resolving `latest` into Vulkan SDK release number'
default: false
required: false
use_arm_artifact:
description: 'Use prebuilt ARM artifacts from GitHub Actions'
default: false
required: false
runs:
using: "composite"
steps:
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.20)
project(test_vulkan)

message(STATUS "")
Expand Down
27 changes: 17 additions & 10 deletions vulkan_prebuilt_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,31 @@ function _os_filename() {
case $1 in
mac) echo vulkan_sdk.dmg ;;
linux) echo vulkan_sdk.tar.gz ;;
linux-arm) echo vulkansdk-linux-arm64-$RUNNER_OS-$VULKAN_SDK_VERSION.zip ;;
windows) echo vulkan_sdk.exe ;;
*) echo "unknown $1" >&2 ; exit 9 ;;
esac
}

function download_vulkan_installer() {
local os=$1
local filename=$(_os_filename $os)
local url=https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VERSION/$os/$filename?Human=true
echo "_download_os_installer $os $filename $url" >&2
if [[ -f $filename ]] ; then
echo "using cached: $filename" >&2
if [[ "$os" == "linux" && "${{ inputs.use_arm_artifact }}" == "true" ]]; then
os="linux-arm"
echo "Downloading ARM artifact for version $VULKAN_SDK_VERSION"
gh run download --pattern "vulkansdk-linux-arm64-$RUNNER_OS-$VULKAN_SDK_VERSION.zip"
unzip vulkansdk-linux-arm64-$RUNNER_OS-$VULKAN_SDK_VERSION.zip -d $VULKAN_SDK
else
curl --fail-with-body -s -L -o ${filename}.tmp $url || { echo "curl failed with error code: $?" >&2 ; curl -s -L --head $url >&2 ; exit 32 ; }
test -f ${filename}.tmp
mv -v ${filename}.tmp ${filename}
fi
ls -lh $filename >&2
local filename=$(_os_filename $os)
local url=https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VERSION/$os/$filename?Human=true
echo "_download_os_installer $os $filename $url" >&2
if [[ -f $filename ]] ; then
echo "using cached: $filename" >&2
else
curl --fail-with-body -s -L -o ${filename}.tmp $url || { echo "curl failed with error code: $?" >&2 ; curl -s -L --head $url >&2 ; exit 32 ; }
test -f ${filename}.tmp
mv -v ${filename}.tmp ${filename}
fi
ls -lh $filename >&2
}

function unpack_vulkan_installer() {
Expand Down