Use composite action for mesa install (#7763)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
sagudev 2025-06-06 19:23:27 +02:00 committed by GitHub
parent 233a25c1e5
commit 55fd09786a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 40 additions and 63 deletions

36
.github/install-mesa-action/action.yml vendored Normal file
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"

View File

@ -29,12 +29,8 @@ env:
DXC_RELEASE: "v1.8.2502" DXC_RELEASE: "v1.8.2502"
DXC_FILENAME: "dxc_2025_02_20.zip" DXC_FILENAME: "dxc_2025_02_20.zip"
# These Mesa version definitions are duplicated in the CTS job. # These Mesa version definition is duplicated in the install-mesa-action.
# 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" MESA_VERSION: "24.3.4"
# Corresponds to https://github.com/gfx-rs/ci-build/releases
CI_BINARY_BUILD: "build20"
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure. # This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.84" REPO_MSRV: "1.84"
@ -627,33 +623,9 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt install -y vulkan-sdk sudo apt install -y vulkan-sdk
# This step is duplicated in the CTS job.
- name: (Linux) Install Mesa - name: (Linux) Install Mesa
if: matrix.os == 'ubuntu-24.04' if: matrix.os == 'ubuntu-24.04'
shell: bash uses: ./.github/install-mesa-action
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"
- name: Delete Naga snapshots - name: Delete Naga snapshots
shell: bash shell: bash

View File

@ -4,7 +4,7 @@ on:
pull_request: pull_request:
types: [labeled, opened, synchronize] types: [labeled, opened, synchronize]
schedule: schedule:
- cron: '33 2 * * *' - cron: "33 2 * * *"
workflow_dispatch: workflow_dispatch:
env: env:
@ -13,13 +13,6 @@ env:
RUST_BACKTRACE: full RUST_BACKTRACE: full
MSRV: "1.84" MSRV: "1.84"
# These Mesa version definitions are duplicated in the CI job.
# 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"
jobs: jobs:
cts: cts:
strategy: strategy:
@ -70,33 +63,9 @@ jobs:
debug = 1 debug = 1
EOF EOF
# This step is duplicated in the CI job.
- name: (Linux) Install Mesa - name: (Linux) Install Mesa
if: matrix.os == 'ubuntu-24.04' if: matrix.os == 'ubuntu-24.04'
shell: bash uses: ./.github/install-mesa-action
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"
- name: run CTS - name: run CTS
shell: bash shell: bash