chore(ci): Test more Burn backends #57
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: validate | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
rustfmt-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt | |
- name: Run cargo fmt | |
run: cargo fmt -- --check | |
# - name: Run cargo clippy | |
# run: cargo clippy -- -D warnings | |
check: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-13, ubuntu-latest, windows-latest] | |
rust: [stable] | |
feature: ['default', 'wgpu', 'torch'] | |
include: | |
- cache: stable | |
rust: stable | |
exclude: | |
# macos on CI does not have Metal GPU | |
- os: macos-13 | |
feature: 'wgpu' | |
# windows can have CPU Vulkan but Burn doesn't select CPU well yet | |
- os: windows-latest | |
feature: 'wgpu' | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: install rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
rustflags: "" # Disable when we're ready | |
- name: caching | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ runner.os }}-${{ matrix.cache }}-${{ matrix.feature }}-${{ hashFiles('**/Cargo.toml') }} | |
- name: (linux) install llvmpipe, lavapipe | |
if: runner.os == 'Linux' | |
run: |- | |
sudo apt-get update -y -qq | |
sudo add-apt-repository ppa:kisak/kisak-mesa -y | |
sudo apt-get update | |
sudo apt install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers | |
- name: (windows) install warp | |
if: runner.os == 'Windows' | |
shell: bash | |
run: |- | |
set -e | |
curl.exe -L https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/1.0.7.1 -o warp.zip | |
7z.exe e warp.zip -owarp build/native/amd64/d3d10warp.dll | |
mkdir -p target/debug/deps | |
cp -v warp/d3d10warp.dll target/debug/ | |
cp -v warp/d3d10warp.dll target/debug/deps | |
- name: (windows) install mesa | |
if: runner.os == 'Windows' | |
shell: bash | |
run: |- | |
set -e | |
curl.exe -L https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z -o mesa.7z | |
7z.exe e mesa.7z -omesa x64/{opengl32.dll,libgallium_wgl.dll,libglapi.dll,vulkan_lvp.dll,lvp_icd.x86_64.json} | |
mkdir -p target/debug/deps | |
cp -v mesa/* target/debug/ | |
cp -v mesa/* target/debug/deps | |
echo "VK_DRIVER_FILES=$PWD/mesa/lvp_icd.x86_64.json" >> "$GITHUB_ENV" | |
echo "GALLIUM_DRIVER=llvmpipe" >> "$GITHUB_ENV" | |
- name: (windows) install dxc | |
if: runner.os == 'Windows' | |
uses: napokue/[email protected] | |
- name: Test | |
run: cargo test --features ${{ matrix.feature }} |