Files
rust-gpu/.github/workflows/ci.yaml
Jake Shadle 44393affe5 Update spirv-tools to 0.5.0 (#496)
* Update spirv-tools to 0.5.0

* Use ubuntu-20.04 image rather than the ambiguous "latest"

* Update spirv-tools binaries to latest
2021-03-16 13:04:23 +01:00

109 lines
4.1 KiB
YAML

on:
push:
branches:
- main
pull_request:
name: CI
jobs:
check:
name: Test
strategy:
matrix:
include:
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macOS-latest
target: x86_64-apple-darwin
- os: ubuntu-20.04
target: aarch64-linux-android
runs-on: ${{ matrix.os }}
env:
spirv_tools_version: "20200928"
steps:
- uses: actions/checkout@v2
# Ubuntu does have `brew install spirv-tools`, but it installs from
# source and so takes >8 minutes.
- if: ${{ runner.os == 'Linux' }}
name: Linux - Install native dependencies
run: |
sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev
mkdir "${HOME}/spirv-tools"
curl -fL https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/linux-clang-release/continuous/1409/20210313-175801/install.tgz | tar -xz -C "${HOME}/spirv-tools"
echo "${HOME}/spirv-tools/install/bin" >> $GITHUB_PATH
- if: ${{ runner.os == 'macOS' }}
name: Mac - Install spirv-tools
run: brew install spirv-tools
# Currently SPIR-V tools aren't available in any package manager
# on Windows that put the tools in the path.
- if: ${{ runner.os == 'Windows' }}
name: Windows - Install spirv-tools
shell: bash
run: |
tmparch=$(mktemp)
mkdir "${HOME}/spirv-tools"
curl -fL -o "$tmparch" https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/windows-msvc-2017-release/continuous/1391/20210313-183536/install.zip
unzip "$tmparch" -d "${HOME}/spirv-tools"
- if: ${{ runner.os == 'Windows' }}
# Runs separately to add spir-v tools to Powershell's Path.
run: echo "$HOME/spirv-tools/install/bin" >> $env:GITHUB_PATH
# Fetch dependencies in a separate step to clearly show how long each part
# of the testing takes
- name: cargo fetch --locked
run: cargo fetch --locked --target ${{ matrix.target }}
- name: Run tests
if: ${{ matrix.target != 'aarch64-linux-android' }}
shell: bash
run: .github/workflows/test.sh ${{ runner.os }}
- name: Build WGPU Example for Android
if: ${{ matrix.target == 'aarch64-linux-android' }}
shell: bash
run: |
echo "::group::Install cargo-apk"
cargo install cargo-apk
echo "::endgroup::"
echo "::group::Add aarch64-linux-android target"
rustup target add aarch64-linux-android
echo "::endgroup::"
echo "::group::Build WGPU example for Android"
cargo apk build --manifest-path examples/runners/wgpu/Cargo.toml --features use-installed-tools --no-default-features
echo "::endgroup::"
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
# Note that we are explicitly NOT checking out submodules, to validate
# that we haven't accidentally enabled spirv-tools native compilation
# and regressed CI times
- uses: actions/checkout@v2
with:
submodules: "false"
- name: Install native dependencies
run: sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev
- name: Install spirv-tools
run: |
mkdir "${HOME}/spirv-tools"
curl -fL https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/linux-clang-release/continuous/1409/20210313-175801/install.tgz | tar -xz -C "${HOME}/spirv-tools"
echo "${HOME}/spirv-tools/install/bin" >> $GITHUB_PATH
- name: Install rustup components
run: rustup component add rustfmt clippy
- name: cargo fetch --locked
run: cargo fetch --locked
- name: Rustfmt
run: cargo fmt --all -- --check
- name: Clippy
run: .github/workflows/clippy.sh
cargo-deny:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1