Updating CI from wgpu #707
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [push] | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
version: ["stable", "1.80.0"] | |
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- | |
name: Free disk space | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo docker rmi $(docker image ls -aq) || true | |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL || true | |
# Sourced from https://github.com/gfx-rs/wgpu/blob/trunk/.github/workflows/ci.yml | |
- name: install vulkan sdk | |
if: matrix.os == 'ubuntu-latest' | |
shell: bash | |
run: | | |
set -e | |
sudo apt-get update -y -qq | |
# vulkan sdk | |
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - | |
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-$VULKAN_SDK_VERSION-jammy.list https://packages.lunarg.com/vulkan/$VULKAN_SDK_VERSION/lunarg-vulkan-$VULKAN_SDK_VERSION-jammy.list | |
sudo apt-get update | |
sudo apt install -y vulkan-sdk | |
# Sourced from https://github.com/gfx-rs/wgpu/blob/trunk/.github/workflows/ci.yml | |
- name: install mesa | |
if: matrix.os == 'ubuntu-latest' | |
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: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.version }} | |
- name: Run clippy | |
if: matrix.version == 'stable' | |
run: | | |
cargo clippy --all-features --all-targets | |
- name: Compile with all features | |
run: | | |
cargo build --all-features --all-targets | |
- name: Run all features unit tests | |
# for msrv, we only check build compatibility, as it's possible bugs are | |
# fixed purely by updating the rust version. | |
if: matrix.version == 'stable' | |
run: | | |
cargo test --all-features --all-targets -- --nocapture | |
env: | |
# When running on Mac OS CI, it's pretty common to not get an adapter | |
# returned. We don't want errors specifically caused by not being able | |
# to create a wgpu Adapter to cause unit test failures on CI. Long | |
# term it would be nice to have a reliable way to run Mac CI with a | |
# GPU adapter available. | |
NO_ADAPTER: ${{ matrix.os == 'macos-latest' && 'github-ci' || '' }} |