[CI] Refactor DXC and WARP installation steps to composite actions

This avoids having to duplicate the steps and version numbers across
mutiple workflows.
This commit is contained in:
Jamie Nicol authored and Connor Fitzgerald committed 2025-06-17 09:14:44 -04:00
1 parent ad4286102a
commit 3ba583cd61
6 files changed
+50 -49

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
name: "Install DXC"
description: "Install DXC"
runs:
using: "composite"
steps:
- shell: bash
run: |
set -e
export DXC_RELEASE="v1.8.2502"
export DXC_FILENAME="dxc_2025_02_20.zip"
curl.exe -L --retry 5 https://github.com/microsoft/DirectXShaderCompiler/releases/download/$DXC_RELEASE/$DXC_FILENAME -o dxc.zip
7z.exe e dxc.zip -odxc bin/x64/{dxc.exe,dxcompiler.dll}
# We need to use cygpath to convert PWD to a windows path as we're using bash.
cygpath --windows "$PWD/dxc" >> "$GITHUB_PATH"
+36
View File
@@ -0,0 +1,36 @@
name: 'Install Mesa'
description: 'Install Mesa'
runs:
using: "composite"
steps:
- name: Install Mesa
shell: bash
env:
# Sourced from https://archive.mesa3d.org/. Bumping this requires
# updating the mesa build in https://github.com/gfx-rs/ci-build and creating a new release.
MESA_VERSION: "24.3.4"
# Corresponds to https://github.com/gfx-rs/ci-build/releases
CI_BINARY_BUILD: "build20"
run: |
set -e
curl -L --retry 5 https://github.com/gfx-rs/ci-build/releases/download/$CI_BINARY_BUILD/mesa-$MESA_VERSION-linux-x86_64.tar.xz -o mesa.tar.xz
mkdir mesa
tar xpf mesa.tar.xz -C mesa
# The ICD provided by the mesa build is hardcoded to the build environment.
#
# We write out our own ICD file to point to the mesa vulkan
cat <<- EOF > icd.json
{
"ICD": {
"api_version": "1.1.255",
"library_path": "$PWD/mesa/lib/x86_64-linux-gnu/libvulkan_lvp.so"
},
"file_format_version": "1.0.0"
}
EOF
echo "VK_DRIVER_FILES=$PWD/icd.json" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=$PWD/mesa/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
echo "LIBGL_DRIVERS_PATH=$PWD/mesa/lib/x86_64-linux-gnu/dri" >> "$GITHUB_ENV"
+25
View File
@@ -0,0 +1,25 @@
name: "Install WARP"
description: "Install WARP"
inputs:
target-dirs:
description: "Space-separated list of directories into which to install the WARP DLL."
required: true
runs:
using: "composite"
steps:
- shell: bash
run: |
set -e
export WARP_VERSION="1.0.13"
# Make sure dxc is in path.
dxc --version
curl.exe -L --retry 5 https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/$WARP_VERSION -o warp.zip
7z.exe e warp.zip -owarp build/native/bin/x64/d3d10warp.dll
for dir in ${{ inputs.target-dirs }}; do
mkdir -p ${{ inputs.target-dirs }}
cp -v warp/d3d10warp.dll "$dir"
done