diff --git a/.github/install-mesa-action/action.yml b/.github/install-mesa-action/action.yml new file mode 100644 index 000000000..d6cbb5808 --- /dev/null +++ b/.github/install-mesa-action/action.yml @@ -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" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26c00d2aa..4bba63e46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,12 +29,8 @@ env: DXC_RELEASE: "v1.8.2502" DXC_FILENAME: "dxc_2025_02_20.zip" - # These Mesa version definitions are duplicated in the CTS 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. + # These Mesa version definition is duplicated in the install-mesa-action. 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. REPO_MSRV: "1.84" @@ -627,33 +623,9 @@ jobs: sudo apt-get update sudo apt install -y vulkan-sdk - # This step is duplicated in the CTS job. - name: (Linux) Install Mesa if: matrix.os == 'ubuntu-24.04' - shell: bash - 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" + uses: ./.github/install-mesa-action - name: Delete Naga snapshots shell: bash diff --git a/.github/workflows/cts.yml b/.github/workflows/cts.yml index c5fdb1430..61efc4f3f 100644 --- a/.github/workflows/cts.yml +++ b/.github/workflows/cts.yml @@ -4,7 +4,7 @@ on: pull_request: types: [labeled, opened, synchronize] schedule: - - cron: '33 2 * * *' + - cron: "33 2 * * *" workflow_dispatch: env: @@ -13,13 +13,6 @@ env: RUST_BACKTRACE: full 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: cts: strategy: @@ -70,33 +63,9 @@ jobs: debug = 1 EOF - # This step is duplicated in the CI job. - name: (Linux) Install Mesa if: matrix.os == 'ubuntu-24.04' - shell: bash - 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" + uses: ./.github/install-mesa-action - name: run CTS shell: bash