diff --git a/.github/actions/install-dxc/action.yml b/.github/actions/install-dxc/action.yml new file mode 100644 index 000000000..b098c2cf1 --- /dev/null +++ b/.github/actions/install-dxc/action.yml @@ -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" diff --git a/.github/install-mesa-action/action.yml b/.github/actions/install-mesa/action.yml similarity index 100% rename from .github/install-mesa-action/action.yml rename to .github/actions/install-mesa/action.yml diff --git a/.github/actions/install-warp/action.yml b/.github/actions/install-warp/action.yml new file mode 100644 index 000000000..03ed180d2 --- /dev/null +++ b/.github/actions/install-warp/action.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b676760d..932a9bdd5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,16 +20,8 @@ env: # Sourced from https://vulkan.lunarg.com/sdk/home#linux VULKAN_SDK_VERSION: "1.4.313" VULKAN_FULL_SDK_VERSION: "1.4.313.0" - # Sourced from https://www.nuget.org/packages/Microsoft.Direct3D.WARP - WARP_VERSION: "1.0.13" - # Sourced from https://github.com/microsoft/DirectXShaderCompiler/releases - # - # Must also be changed in shaders.yaml - DXC_RELEASE: "v1.8.2502" - DXC_FILENAME: "dxc_2025_02_20.zip" - - # These Mesa version definition is duplicated in the install-mesa-action. + # These Mesa version definition is duplicated in the install-mesa action. MESA_VERSION: "24.3.4" # This is the MSRV used by `wgpu` itself and all surrounding infrastructure. @@ -541,32 +533,13 @@ jobs: - name: (Windows) Install DXC if: matrix.os == 'windows-2022' - shell: bash - run: | - set -e - - 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" + uses: ./.github/actions/install-dxc - name: (Windows) Install WARP if: matrix.os == 'windows-2022' - shell: bash - run: | - set -e - - # 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 - - mkdir -p target/llvm-cov-target/debug/deps - - cp -v warp/d3d10warp.dll target/llvm-cov-target/debug/ - cp -v warp/d3d10warp.dll target/llvm-cov-target/debug/deps + uses: ./.github/actions/install-warp + with: + target-dirs: "target/llvm-cov-target/debug target/llvm-cov-target/debug/deps" - name: (Windows) Install Mesa if: matrix.os == 'windows-2022' @@ -627,7 +600,7 @@ jobs: - name: (Linux) Install Mesa if: matrix.os == 'ubuntu-24.04' - uses: ./.github/install-mesa-action + uses: ./.github/actions/install-mesa - name: Delete Naga snapshots shell: bash diff --git a/.github/workflows/cts.yml b/.github/workflows/cts.yml index 61efc4f3f..4120c2117 100644 --- a/.github/workflows/cts.yml +++ b/.github/workflows/cts.yml @@ -65,7 +65,7 @@ jobs: - name: (Linux) Install Mesa if: matrix.os == 'ubuntu-24.04' - uses: ./.github/install-mesa-action + uses: ./.github/actions/install-mesa - name: run CTS shell: bash diff --git a/.github/workflows/shaders.yml b/.github/workflows/shaders.yml index c5742bff3..8bcd64515 100644 --- a/.github/workflows/shaders.yml +++ b/.github/workflows/shaders.yml @@ -18,12 +18,6 @@ env: # We don't include the 4th version number, as it's not used in any URL. VULKAN_SDK_VERSION: "1.4.313" - # Sourced from https://github.com/microsoft/DirectXShaderCompiler/releases - # - # Must also be changed in ci.yaml - DXC_RELEASE: "v1.8.2502" - DXC_FILENAME: "dxc_2025_02_20.zip" - jobs: naga-validate-windows: name: "Validate: HLSL" @@ -56,15 +50,7 @@ jobs: shell: powershell - name: Setup DXC - shell: bash - run: | - set -e - - 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" + uses: ./.github/actions/install-dxc - name: Validate shell: bash