2020-04-22 13:03:26 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-10-15 02:55:36 +00:00
|
|
|
branches: ["*"]
|
2021-05-04 01:46:01 +00:00
|
|
|
tags: [v0.*]
|
2020-04-22 13:03:26 +00:00
|
|
|
pull_request:
|
2023-02-09 00:52:25 +00:00
|
|
|
merge_group:
|
2020-04-22 13:03:26 +00:00
|
|
|
|
2021-09-14 01:27:50 +00:00
|
|
|
env:
|
2024-01-04 08:41:13 +00:00
|
|
|
#
|
|
|
|
# Dependency versioning
|
|
|
|
#
|
|
|
|
|
|
|
|
# Sourced from https://vulkan.lunarg.com/sdk/home#linux
|
2024-09-22 04:35:26 +00:00
|
|
|
#
|
|
|
|
# We don't include the 4th version number, as it's not used in any URL.
|
|
|
|
VULKAN_SDK_VERSION: "1.3.290"
|
2024-01-04 08:41:13 +00:00
|
|
|
# Sourced from https://www.nuget.org/packages/Microsoft.Direct3D.WARP
|
2024-09-22 04:35:26 +00:00
|
|
|
WARP_VERSION: "1.0.13"
|
2024-01-04 08:41:13 +00:00
|
|
|
|
|
|
|
# Sourced from https://github.com/microsoft/DirectXShaderCompiler/releases
|
|
|
|
#
|
|
|
|
# Must also be changed in shaders.yaml
|
2024-09-22 04:35:26 +00:00
|
|
|
DXC_RELEASE: "v1.8.2407"
|
|
|
|
DXC_FILENAME: "dxc_2024_07_31_clang_cl.zip"
|
2024-01-04 08:41:13 +00:00
|
|
|
|
|
|
|
# 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.
|
2024-09-22 04:35:26 +00:00
|
|
|
MESA_VERSION: "24.2.3"
|
2024-01-04 08:41:13 +00:00
|
|
|
# Corresponds to https://github.com/gfx-rs/ci-build/releases
|
2024-09-22 04:35:26 +00:00
|
|
|
CI_BINARY_BUILD: "build19"
|
2024-01-04 03:49:40 +00:00
|
|
|
|
2024-01-06 07:58:34 +00:00
|
|
|
# We sometimes need nightly to use special things in CI.
|
2024-01-11 01:57:51 +00:00
|
|
|
#
|
2024-01-06 07:58:34 +00:00
|
|
|
# In order to prevent CI regressions, we pin the nightly version.
|
|
|
|
NIGHTLY_VERSION: "nightly-2023-12-17"
|
2023-10-04 01:03:32 +00:00
|
|
|
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
|
2024-02-27 19:43:05 +00:00
|
|
|
REPO_MSRV: "1.76"
|
2023-10-04 01:03:32 +00:00
|
|
|
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
|
|
|
|
# to ensure that they can be used with firefox.
|
2024-07-20 19:20:05 +00:00
|
|
|
CORE_MSRV: "1.76"
|
2024-01-04 08:41:13 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Environment variables
|
|
|
|
#
|
|
|
|
|
|
|
|
CARGO_INCREMENTAL: false
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
WGPU_DX12_COMPILER: dxc
|
|
|
|
RUST_LOG: info
|
|
|
|
RUST_BACKTRACE: full
|
2022-10-15 02:55:36 +00:00
|
|
|
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
|
2024-03-01 21:13:14 +00:00
|
|
|
RUSTFLAGS: -D warnings
|
|
|
|
RUSTDOCFLAGS: -D warnings
|
2024-01-13 11:26:55 +00:00
|
|
|
WASM_BINDGEN_TEST_TIMEOUT: 300 # 5 minutes
|
2022-10-15 02:55:36 +00:00
|
|
|
CACHE_SUFFIX: c # cache busting
|
2024-07-24 11:40:32 +00:00
|
|
|
WGPU_TESTING: true
|
2021-09-14 01:27:50 +00:00
|
|
|
|
2021-12-03 16:43:22 +00:00
|
|
|
# We distinguish the following kinds of builds:
|
2022-10-15 02:55:36 +00:00
|
|
|
# - native: build for the same target as we compile on
|
2021-12-03 16:43:22 +00:00
|
|
|
# - web: build for the Web
|
2022-01-25 10:35:45 +00:00
|
|
|
# - em: build for the Emscripten
|
2021-12-03 16:43:22 +00:00
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
# For build time and size optimization we disable debug
|
|
|
|
# entirely on clippy jobs and reduce it to line-numbers
|
|
|
|
# only for ones where we run tests.
|
|
|
|
#
|
2022-11-07 18:32:41 +00:00
|
|
|
# Additionally, we disable incremental builds entirely
|
2022-10-15 02:55:36 +00:00
|
|
|
# as our caching system doesn't actually cache our crates.
|
|
|
|
# It adds overhead to the build and another point of failure.
|
|
|
|
|
2020-04-22 13:03:26 +00:00
|
|
|
jobs:
|
2023-10-04 01:03:32 +00:00
|
|
|
check:
|
2024-01-13 11:26:55 +00:00
|
|
|
# runtime is normally 2-8 minutes
|
2024-01-25 05:11:43 +00:00
|
|
|
#
|
|
|
|
# currently high due to documentation time problems on mac.
|
2024-04-19 00:49:39 +00:00
|
|
|
# https://github.com/rust-lang/rust/issues/114891
|
2024-01-25 05:11:43 +00:00
|
|
|
timeout-minutes: 30
|
2024-01-13 11:26:55 +00:00
|
|
|
|
2020-04-22 13:03:26 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2021-07-04 02:10:10 +00:00
|
|
|
# Windows
|
|
|
|
- name: Windows x86_64
|
2022-10-15 02:55:36 +00:00
|
|
|
os: windows-2022
|
2021-09-14 01:27:50 +00:00
|
|
|
target: x86_64-pc-windows-msvc
|
2022-10-15 02:55:36 +00:00
|
|
|
kind: native
|
2022-11-07 18:32:41 +00:00
|
|
|
|
2021-07-04 02:10:10 +00:00
|
|
|
# MacOS
|
|
|
|
- name: MacOS x86_64
|
2024-01-30 21:04:11 +00:00
|
|
|
os: macos-14
|
2021-07-04 02:10:10 +00:00
|
|
|
target: x86_64-apple-darwin
|
2022-10-15 02:55:36 +00:00
|
|
|
kind: native
|
2021-12-03 20:38:40 +00:00
|
|
|
|
|
|
|
- name: MacOS aarch64
|
2024-01-30 21:04:11 +00:00
|
|
|
os: macos-14
|
2021-12-03 20:38:40 +00:00
|
|
|
target: aarch64-apple-darwin
|
2022-10-15 02:55:36 +00:00
|
|
|
kind: native
|
2022-11-07 18:32:41 +00:00
|
|
|
|
2021-07-04 02:10:10 +00:00
|
|
|
# IOS
|
|
|
|
- name: IOS aarch64
|
2024-01-30 21:04:11 +00:00
|
|
|
os: macos-14
|
2021-07-04 02:10:10 +00:00
|
|
|
target: aarch64-apple-ios
|
2022-10-15 02:55:36 +00:00
|
|
|
kind: native
|
2021-07-04 02:10:10 +00:00
|
|
|
|
|
|
|
# Linux
|
|
|
|
- name: Linux x86_64
|
2022-10-15 02:55:36 +00:00
|
|
|
os: ubuntu-22.04
|
2021-07-04 02:10:10 +00:00
|
|
|
target: x86_64-unknown-linux-gnu
|
2022-10-15 02:55:36 +00:00
|
|
|
kind: native
|
2021-07-04 02:10:10 +00:00
|
|
|
|
2021-12-03 20:38:40 +00:00
|
|
|
- name: Linux aarch64
|
2022-10-15 02:55:36 +00:00
|
|
|
os: ubuntu-22.04
|
2021-12-03 20:38:40 +00:00
|
|
|
target: aarch64-unknown-linux-gnu
|
2022-10-15 02:55:36 +00:00
|
|
|
kind: native
|
2021-12-03 20:38:40 +00:00
|
|
|
|
2021-07-04 02:10:10 +00:00
|
|
|
# Android
|
|
|
|
- name: Android aarch64
|
2022-10-15 02:55:36 +00:00
|
|
|
os: ubuntu-22.04
|
2021-07-04 02:10:10 +00:00
|
|
|
target: aarch64-linux-android
|
2022-10-15 02:55:36 +00:00
|
|
|
kind: native
|
2021-07-04 02:10:10 +00:00
|
|
|
|
|
|
|
# WebGPU/WebGL
|
|
|
|
- name: WebAssembly
|
2022-10-15 02:55:36 +00:00
|
|
|
os: ubuntu-22.04
|
2021-07-04 02:10:10 +00:00
|
|
|
target: wasm32-unknown-unknown
|
2021-12-03 16:43:22 +00:00
|
|
|
kind: web
|
2021-07-04 02:10:10 +00:00
|
|
|
|
2022-01-25 10:35:45 +00:00
|
|
|
- name: Emscripten
|
2022-10-15 02:55:36 +00:00
|
|
|
os: ubuntu-22.04
|
2022-01-25 10:35:45 +00:00
|
|
|
target: wasm32-unknown-emscripten
|
|
|
|
kind: em
|
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
name: Clippy ${{ matrix.name }}
|
2021-07-04 02:10:10 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
2020-04-22 13:03:26 +00:00
|
|
|
steps:
|
2021-07-04 02:10:10 +00:00
|
|
|
- name: checkout repo
|
2023-09-05 13:27:38 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-07-04 02:10:10 +00:00
|
|
|
|
2023-10-04 01:03:32 +00:00
|
|
|
- name: Install Repo MSRV toolchain
|
2023-02-09 15:33:53 +00:00
|
|
|
run: |
|
2023-10-04 01:03:32 +00:00
|
|
|
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy --target ${{ matrix.target }}
|
|
|
|
rustup override set ${{ env.REPO_MSRV }}
|
|
|
|
cargo -V
|
2021-07-03 06:24:38 +00:00
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
- name: disable debug
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir -p .cargo
|
|
|
|
echo """
|
|
|
|
[profile.dev]
|
|
|
|
debug = false" >> .cargo/config.toml
|
2021-12-03 15:37:26 +00:00
|
|
|
|
2021-09-14 01:27:50 +00:00
|
|
|
- name: caching
|
2024-01-16 16:37:27 +00:00
|
|
|
uses: Swatinem/rust-cache@v2
|
2021-09-14 01:27:50 +00:00
|
|
|
with:
|
2022-10-15 02:55:36 +00:00
|
|
|
key: clippy-${{ matrix.target }}-${{ matrix.kind }}-${{ env.CACHE_SUFFIX }}
|
2022-02-19 15:50:17 +00:00
|
|
|
|
2023-10-22 04:34:00 +00:00
|
|
|
- name: (linux aarch64) install aarch64-linux-gnu g++
|
2023-06-08 15:48:06 +00:00
|
|
|
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
|
|
|
|
sudo apt-get update -y -qq
|
|
|
|
|
|
|
|
sudo apt-get install g++-aarch64-linux-gnu
|
|
|
|
|
2023-10-22 04:34:00 +00:00
|
|
|
- name: (android) add android apk to path
|
2022-10-15 02:55:36 +00:00
|
|
|
if: matrix.target == 'aarch64-linux-android'
|
2021-07-04 02:10:10 +00:00
|
|
|
run: |
|
2023-06-08 15:48:06 +00:00
|
|
|
# clang++ will be detected correctly by CC from path
|
|
|
|
echo "$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
# the android sdk doesn't use the conventional name for ar, so explicitly set it.
|
|
|
|
echo "AR_aarch64_linux_android=llvm-ar" >> "$GITHUB_ENV"
|
2021-07-03 06:24:38 +00:00
|
|
|
|
2021-07-04 02:10:10 +00:00
|
|
|
- name: check web
|
2021-12-03 16:43:22 +00:00
|
|
|
if: matrix.kind == 'web'
|
2022-10-15 02:55:36 +00:00
|
|
|
shell: bash
|
2021-07-04 02:10:10 +00:00
|
|
|
run: |
|
2022-10-15 02:55:36 +00:00
|
|
|
set -e
|
2022-10-08 05:12:50 +00:00
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
# build for WebGPU
|
2023-06-29 20:31:18 +00:00
|
|
|
cargo clippy --target ${{ matrix.target }} --tests --features glsl,spirv,fragile-send-sync-non-atomic-wasm
|
2023-06-10 18:35:46 +00:00
|
|
|
cargo clippy --target ${{ matrix.target }} --tests --features glsl,spirv
|
2024-08-21 07:18:35 +00:00
|
|
|
cargo doc --target ${{ matrix.target }} --no-deps --features glsl,spirv
|
2021-07-13 03:15:47 +00:00
|
|
|
|
2023-02-21 12:50:55 +00:00
|
|
|
# all features
|
2023-06-10 18:35:46 +00:00
|
|
|
cargo clippy --target ${{ matrix.target }} --tests --all-features
|
2024-08-21 07:18:35 +00:00
|
|
|
cargo doc --target ${{ matrix.target }} --no-deps --all-features
|
2023-02-21 12:50:55 +00:00
|
|
|
|
2022-01-25 10:35:45 +00:00
|
|
|
- name: check em
|
|
|
|
if: matrix.kind == 'em'
|
2022-10-15 02:55:36 +00:00
|
|
|
shell: bash
|
2022-01-25 10:35:45 +00:00
|
|
|
run: |
|
2022-10-15 02:55:36 +00:00
|
|
|
set -e
|
|
|
|
|
2023-02-21 12:50:55 +00:00
|
|
|
# build for Emscripten
|
2023-02-15 21:46:00 +00:00
|
|
|
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-hal --no-default-features
|
2022-11-30 21:46:24 +00:00
|
|
|
|
2023-07-23 22:43:11 +00:00
|
|
|
# Don't check samples since we use winit in our samples which has dropped support for Emscripten.
|
2022-01-25 10:35:45 +00:00
|
|
|
|
2023-02-21 12:50:55 +00:00
|
|
|
# all features
|
|
|
|
cargo clippy --target ${{ matrix.target }} -p wgpu-hal --all-features
|
|
|
|
cargo clippy --target ${{ matrix.target }} -p wgpu --all-features
|
|
|
|
|
2021-09-14 01:27:50 +00:00
|
|
|
- name: check native
|
2022-10-15 02:55:36 +00:00
|
|
|
if: matrix.kind == 'native'
|
|
|
|
shell: bash
|
2021-07-04 02:10:10 +00:00
|
|
|
run: |
|
2022-10-15 02:55:36 +00:00
|
|
|
set -e
|
|
|
|
|
2021-07-04 02:10:10 +00:00
|
|
|
# check with no features
|
2023-06-10 18:35:46 +00:00
|
|
|
cargo clippy --target ${{ matrix.target }} --no-default-features
|
2021-07-03 06:24:38 +00:00
|
|
|
|
2022-12-08 01:58:45 +00:00
|
|
|
# Check with all features.
|
2024-05-16 13:05:41 +00:00
|
|
|
cargo clippy --target ${{ matrix.target }} --tests --benches --all-features
|
2021-06-22 05:38:41 +00:00
|
|
|
|
2021-07-13 03:15:47 +00:00
|
|
|
# build docs
|
2024-08-21 07:18:35 +00:00
|
|
|
cargo doc --target ${{ matrix.target }} --all-features --no-deps
|
|
|
|
|
2024-09-05 19:28:47 +00:00
|
|
|
- name: check private item docs
|
|
|
|
if: matrix.kind == 'native'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# wgpu_core package
|
|
|
|
cargo doc --target ${{ matrix.target }} \
|
|
|
|
--package wgpu-core \
|
|
|
|
--package wgpu-hal \
|
|
|
|
--package naga \
|
|
|
|
--all-features --no-deps --document-private-items
|
2021-07-13 03:15:47 +00:00
|
|
|
|
2023-10-04 01:03:32 +00:00
|
|
|
# We run minimal checks on the MSRV of the core crates, ensuring that
|
|
|
|
# its dependency tree does not cause issues for firefox.
|
|
|
|
#
|
|
|
|
# We don't test all platforms, just ones with different dependency stacks.
|
|
|
|
check-core-msrv:
|
2024-01-13 11:26:55 +00:00
|
|
|
# runtime is normally 1-3 minutes
|
|
|
|
timeout-minutes: 10
|
|
|
|
|
2023-10-04 01:03:32 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
# Windows
|
|
|
|
- name: Windows x86_64
|
|
|
|
os: windows-2022
|
|
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
|
|
|
|
# MacOS
|
|
|
|
- name: MacOS x86_64
|
2024-01-30 21:04:11 +00:00
|
|
|
os: macos-14
|
2023-10-04 01:03:32 +00:00
|
|
|
target: x86_64-apple-darwin
|
|
|
|
|
|
|
|
# Linux
|
|
|
|
- name: Linux x86_64
|
|
|
|
os: ubuntu-22.04
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
|
|
|
|
name: MSRV Check ${{ matrix.name }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: checkout repo
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Install Core MSRV toolchain
|
|
|
|
run: |
|
|
|
|
rustup toolchain install ${{ env.CORE_MSRV }} --no-self-update --profile=minimal --component clippy --target ${{ matrix.target }}
|
|
|
|
rustup override set ${{ env.CORE_MSRV }}
|
|
|
|
cargo -V
|
|
|
|
|
|
|
|
- name: disable debug
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir -p .cargo
|
|
|
|
echo """
|
|
|
|
[profile.dev]
|
|
|
|
debug = false" >> .cargo/config.toml
|
|
|
|
|
|
|
|
- name: caching
|
2024-01-16 16:37:27 +00:00
|
|
|
uses: Swatinem/rust-cache@v2
|
2023-10-04 01:03:32 +00:00
|
|
|
with:
|
|
|
|
key: msrv-check-${{ matrix.target }}-${{ env.CACHE_SUFFIX }}
|
|
|
|
|
|
|
|
- name: check native
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# check wgpu-core with all features. This will also get wgpu-hal and wgpu-types.
|
|
|
|
cargo check --target ${{ matrix.target }} --all-features -p wgpu-core
|
|
|
|
|
2023-10-25 20:51:36 +00:00
|
|
|
naga-minimal-versions:
|
2024-01-13 11:26:55 +00:00
|
|
|
# runtime is normally 2 minutes
|
|
|
|
timeout-minutes: 10
|
|
|
|
|
2023-10-25 20:51:36 +00:00
|
|
|
name: MSRV naga Minimal Versions
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: checkout repo
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Install Core MSRV toolchain
|
|
|
|
run: |
|
|
|
|
rustup toolchain install ${{ env.CORE_MSRV }} --no-self-update --profile=minimal --component clippy
|
|
|
|
rustup override set ${{ env.CORE_MSRV }}
|
|
|
|
cargo -V
|
|
|
|
|
2024-01-06 07:58:34 +00:00
|
|
|
- name: Install Nightly Toolchain
|
2023-10-25 20:51:36 +00:00
|
|
|
run: |
|
2024-01-06 07:58:34 +00:00
|
|
|
rustup toolchain install ${{ env.NIGHTLY_VERSION }} --no-self-update --profile=minimal --component clippy
|
|
|
|
cargo +${{ env.NIGHTLY_VERSION }} -V
|
2023-10-25 20:51:36 +00:00
|
|
|
|
|
|
|
- name: Install cargo-hack
|
|
|
|
uses: taiki-e/install-action@v2
|
|
|
|
with:
|
|
|
|
tool: cargo-hack
|
|
|
|
|
|
|
|
- name: disable debug
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir -p .cargo
|
|
|
|
echo """
|
|
|
|
[profile.dev]
|
|
|
|
debug = false" >> .cargo/config.toml
|
|
|
|
|
|
|
|
- name: Set Minimal Versions
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
|
2024-01-06 07:58:34 +00:00
|
|
|
cargo +${{ env.NIGHTLY_VERSION }} hack generate-lockfile --remove-dev-deps -Z minimal-versions -p naga -p naga-cli
|
2023-10-25 20:51:36 +00:00
|
|
|
|
|
|
|
- name: Clippy
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cargo clippy --all-features -p naga -p naga-cli
|
|
|
|
|
2022-12-09 01:02:39 +00:00
|
|
|
wasm-test:
|
2024-01-13 11:26:55 +00:00
|
|
|
# runtime is normally 2 minutes
|
|
|
|
timeout-minutes: 10
|
2024-02-27 19:43:05 +00:00
|
|
|
|
2022-12-09 01:02:39 +00:00
|
|
|
name: Test WebAssembly
|
|
|
|
runs-on: ubuntu-latest
|
2024-01-10 22:56:46 +00:00
|
|
|
needs: [check]
|
2024-01-11 01:57:51 +00:00
|
|
|
|
2022-12-09 01:02:39 +00:00
|
|
|
steps:
|
|
|
|
- name: checkout repo
|
2023-09-05 13:27:38 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-12-09 01:02:39 +00:00
|
|
|
|
2023-10-04 01:03:32 +00:00
|
|
|
- name: Install Repo MSRV toolchain
|
|
|
|
run: |
|
|
|
|
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy --target wasm32-unknown-unknown
|
|
|
|
rustup override set ${{ env.REPO_MSRV }}
|
|
|
|
cargo -V
|
|
|
|
|
2023-05-07 06:08:50 +00:00
|
|
|
- name: Install wasm-pack
|
|
|
|
uses: taiki-e/install-action@v2
|
|
|
|
with:
|
|
|
|
tool: wasm-pack
|
2022-12-09 01:02:39 +00:00
|
|
|
|
|
|
|
- name: execute tests
|
|
|
|
run: |
|
|
|
|
cd wgpu
|
2024-01-14 09:45:52 +00:00
|
|
|
wasm-pack test --headless --chrome --no-default-features --features wgsl,webgl --workspace
|
2022-12-09 01:02:39 +00:00
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
gpu-test:
|
2024-01-13 11:26:55 +00:00
|
|
|
# runtime is normally 5-15 minutes
|
|
|
|
timeout-minutes: 30
|
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
# Windows
|
|
|
|
- name: Windows x86_64
|
|
|
|
os: windows-2022
|
|
|
|
|
2023-06-05 15:38:30 +00:00
|
|
|
# Mac
|
2024-01-08 21:12:57 +00:00
|
|
|
- name: Mac aarch64
|
2024-01-30 21:04:11 +00:00
|
|
|
os: macos-14
|
2023-06-05 15:38:30 +00:00
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
# Linux
|
2024-01-04 03:49:40 +00:00
|
|
|
- name: Linux x86_64
|
|
|
|
os: ubuntu-22.04
|
2022-11-07 18:32:41 +00:00
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
name: Test ${{ matrix.name }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
2024-01-10 22:56:46 +00:00
|
|
|
needs: [check]
|
2022-10-15 02:55:36 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: checkout repo
|
2023-09-05 13:27:38 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-10-15 02:55:36 +00:00
|
|
|
|
2023-10-22 04:34:00 +00:00
|
|
|
- name: Install Repo MSRV toolchain
|
|
|
|
run: |
|
|
|
|
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal -c llvm-tools
|
|
|
|
cargo -V
|
|
|
|
|
2023-02-09 15:33:53 +00:00
|
|
|
- name: Install cargo-nextest and cargo-llvm-cov
|
|
|
|
uses: taiki-e/install-action@v2
|
2022-10-15 02:55:36 +00:00
|
|
|
with:
|
2023-02-09 15:33:53 +00:00
|
|
|
tool: cargo-nextest,cargo-llvm-cov
|
2022-11-07 18:32:41 +00:00
|
|
|
|
2023-10-23 04:31:22 +00:00
|
|
|
# Cache step must go before warp and mesa install on windows as they write into the
|
|
|
|
# target directory, and rust-cache will overwrite the entirety of the target directory.
|
|
|
|
- name: caching
|
2024-01-16 16:37:27 +00:00
|
|
|
uses: Swatinem/rust-cache@v2
|
2023-10-23 04:31:22 +00:00
|
|
|
with:
|
|
|
|
key: test-${{ matrix.os }}-${{ env.CACHE_SUFFIX }}
|
|
|
|
workspaces: |
|
|
|
|
. -> target
|
|
|
|
xtask -> xtask/target
|
|
|
|
|
2023-10-26 08:01:38 +00:00
|
|
|
- name: (windows) install dxc
|
|
|
|
if: matrix.os == 'windows-2022'
|
2024-01-04 08:41:13 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
|
|
|
|
curl.exe -L --retry 5 https://github.com/microsoft/DirectXShaderCompiler/releases/download/$DXC_RELEASE/$DXC_FILENAME -o dxc.zip
|
|
|
|
7z.exe e dxc.zip -odxc bin/x64/{dxc.exe,dxcompiler.dll,dxil.dll}
|
|
|
|
|
|
|
|
# We need to use cygpath to convert PWD to a windows path as we're using bash.
|
|
|
|
cygpath --windows "$PWD/dxc" >> "$GITHUB_PATH"
|
2023-10-26 08:01:38 +00:00
|
|
|
|
2023-10-22 04:34:00 +00:00
|
|
|
- name: (windows) install warp
|
|
|
|
if: matrix.os == 'windows-2022'
|
|
|
|
shell: bash
|
2021-07-28 04:19:59 +00:00
|
|
|
run: |
|
2023-10-22 04:34:00 +00:00
|
|
|
set -e
|
|
|
|
|
2024-01-04 08:41:13 +00:00
|
|
|
# Make sure dxc is in path.
|
|
|
|
dxc --version
|
|
|
|
|
|
|
|
curl.exe -L --retry 5 https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/$WARP_VERSION -o warp.zip
|
2024-09-22 04:35:26 +00:00
|
|
|
7z.exe e warp.zip -owarp build/native/bin/x64/d3d10warp.dll
|
2023-10-22 04:34:00 +00:00
|
|
|
|
|
|
|
mkdir -p target/llvm-cov-target/debug/deps
|
|
|
|
|
|
|
|
cp -v warp/d3d10warp.dll target/llvm-cov-target/debug/
|
|
|
|
cp -v warp/d3d10warp.dll target/llvm-cov-target/debug/deps
|
2022-11-07 18:32:41 +00:00
|
|
|
|
2023-10-22 04:34:00 +00:00
|
|
|
- name: (windows) install mesa
|
|
|
|
if: matrix.os == 'windows-2022'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
|
2024-01-04 03:49:40 +00:00
|
|
|
curl.exe -L --retry 5 https://github.com/pal1000/mesa-dist-win/releases/download/$MESA_VERSION/mesa3d-$MESA_VERSION-release-msvc.7z -o mesa.7z
|
2023-10-22 04:34:00 +00:00
|
|
|
7z.exe e mesa.7z -omesa x64/{opengl32.dll,libgallium_wgl.dll,libglapi.dll,vulkan_lvp.dll,lvp_icd.x86_64.json}
|
|
|
|
|
|
|
|
cp -v mesa/* target/llvm-cov-target/debug/
|
|
|
|
cp -v mesa/* target/llvm-cov-target/debug/deps
|
|
|
|
|
2024-01-04 08:41:13 +00:00
|
|
|
# We need to use cygpath to convert PWD to a windows path as we're using bash.
|
|
|
|
echo "VK_DRIVER_FILES=`cygpath --windows $PWD/mesa/lvp_icd.x86_64.json`" >> "$GITHUB_ENV"
|
2023-10-22 04:34:00 +00:00
|
|
|
echo "GALLIUM_DRIVER=llvmpipe" >> "$GITHUB_ENV"
|
|
|
|
|
2024-01-04 03:49:40 +00:00
|
|
|
- name: (linux) install vulkan sdk
|
2022-10-15 02:55:36 +00:00
|
|
|
if: matrix.os == 'ubuntu-22.04'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
2022-11-07 18:32:41 +00:00
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
sudo apt-get update -y -qq
|
|
|
|
|
|
|
|
# vulkan sdk
|
|
|
|
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
|
2024-01-04 08:41:13 +00:00
|
|
|
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
|
2022-10-15 02:55:36 +00:00
|
|
|
|
|
|
|
sudo apt-get update
|
2024-01-04 03:49:40 +00:00
|
|
|
sudo apt install -y vulkan-sdk
|
|
|
|
|
|
|
|
- name: (linux) install mesa
|
|
|
|
if: matrix.os == 'ubuntu-22.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
|
|
|
|
|
2024-01-04 08:41:13 +00:00
|
|
|
# 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
|
2024-01-04 03:49:40 +00:00
|
|
|
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"
|
2022-10-15 02:55:36 +00:00
|
|
|
|
|
|
|
- name: disable debug
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir -p .cargo
|
|
|
|
echo """
|
|
|
|
[profile.dev]
|
|
|
|
debug = 1" >> .cargo/config.toml
|
|
|
|
|
2023-10-22 04:34:00 +00:00
|
|
|
- name: run wgpu-info
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "$PATH"
|
2024-01-02 19:10:53 +00:00
|
|
|
|
2023-10-22 04:34:00 +00:00
|
|
|
export RUST_LOG=trace
|
|
|
|
|
|
|
|
# This needs to match the command in xtask/tests.rs
|
2024-01-05 08:24:16 +00:00
|
|
|
cargo llvm-cov --no-cfg-coverage --no-report run --bin wgpu-info -- -vv
|
2022-10-15 02:55:36 +00:00
|
|
|
|
|
|
|
- name: run tests
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
|
2023-10-19 16:06:42 +00:00
|
|
|
cargo xtask test --llvm-cov
|
2021-09-03 17:53:10 +00:00
|
|
|
|
2023-10-25 20:51:36 +00:00
|
|
|
- name: check naga snapshots
|
2024-06-11 19:13:42 +00:00
|
|
|
# git diff doesn't check untracked files, we need to stage those then compare with HEAD.
|
|
|
|
run: git add . && git diff --exit-code HEAD naga/tests/out
|
2023-10-25 20:51:36 +00:00
|
|
|
|
2024-01-05 04:30:30 +00:00
|
|
|
- uses: actions/upload-artifact@v4
|
2023-09-04 03:54:39 +00:00
|
|
|
if: always() # We want artifacts even if the tests fail.
|
2023-06-08 15:48:06 +00:00
|
|
|
with:
|
2024-01-05 04:30:30 +00:00
|
|
|
name: comparison-images-${{ matrix.os }}
|
2023-06-08 15:48:06 +00:00
|
|
|
path: |
|
|
|
|
**/*-actual.png
|
|
|
|
**/*-difference.png
|
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
- name: generate coverage report
|
2023-10-27 05:24:46 +00:00
|
|
|
id: coverage
|
2022-10-15 02:55:36 +00:00
|
|
|
shell: bash
|
2023-10-27 05:24:46 +00:00
|
|
|
continue-on-error: true
|
2022-10-15 02:55:36 +00:00
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cargo llvm-cov report --lcov --output-path lcov.info
|
|
|
|
|
|
|
|
- name: upload coverage report to codecov
|
2024-09-20 19:43:10 +00:00
|
|
|
uses: codecov/codecov-action@v4
|
2023-10-27 05:24:46 +00:00
|
|
|
if: steps.coverage.outcome == 'success'
|
2022-10-15 02:55:36 +00:00
|
|
|
with:
|
|
|
|
files: lcov.info
|
2024-07-18 20:56:30 +00:00
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
2022-11-07 18:32:41 +00:00
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
doctest:
|
2024-01-13 11:26:55 +00:00
|
|
|
# runtime is normally 2 minutes
|
|
|
|
timeout-minutes: 10
|
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
name: Doctest
|
2023-02-09 15:33:53 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-10-15 02:55:36 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: checkout repo
|
2023-09-05 13:27:38 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-10-15 02:55:36 +00:00
|
|
|
|
2023-10-04 01:03:32 +00:00
|
|
|
- name: Install Repo MSRV toolchain
|
|
|
|
run: |
|
|
|
|
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component rustfmt
|
|
|
|
rustup override set ${{ env.REPO_MSRV }}
|
|
|
|
cargo -V
|
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
- name: disable debug
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir -p .cargo
|
|
|
|
echo """
|
|
|
|
[profile.dev]
|
|
|
|
debug = 1" >> .cargo/config.toml
|
|
|
|
|
|
|
|
- name: caching
|
2024-01-16 16:37:27 +00:00
|
|
|
uses: Swatinem/rust-cache@v2
|
2022-10-15 02:55:36 +00:00
|
|
|
with:
|
2023-10-04 01:03:32 +00:00
|
|
|
key: doctests-${{ env.CACHE_SUFFIX }}
|
2022-10-15 02:55:36 +00:00
|
|
|
|
|
|
|
- name: run doctests
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
|
2023-06-10 18:35:46 +00:00
|
|
|
cargo test --doc
|
2022-10-15 02:55:36 +00:00
|
|
|
|
2021-07-04 02:10:10 +00:00
|
|
|
fmt:
|
2024-01-13 11:26:55 +00:00
|
|
|
# runtime is normally 15 seconds
|
|
|
|
timeout-minutes: 2
|
|
|
|
|
2024-02-05 17:30:29 +00:00
|
|
|
name: Format & Typos
|
2021-03-12 17:39:04 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-07-04 02:10:10 +00:00
|
|
|
- name: checkout repo
|
2023-09-05 13:27:38 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-07-04 02:10:10 +00:00
|
|
|
|
2023-10-04 01:03:32 +00:00
|
|
|
- name: Install Repo MSRV toolchain
|
|
|
|
run: |
|
|
|
|
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component rustfmt
|
|
|
|
rustup override set ${{ env.REPO_MSRV }}
|
|
|
|
cargo -V
|
|
|
|
|
2024-10-07 13:05:33 +00:00
|
|
|
- name: Run `cargo fmt`
|
2021-07-04 02:10:10 +00:00
|
|
|
run: |
|
|
|
|
cargo fmt -- --check
|
2023-10-19 16:06:42 +00:00
|
|
|
cargo fmt --manifest-path xtask/Cargo.toml -- --check
|
2024-10-07 06:49:10 +00:00
|
|
|
cargo fmt --manifest-path naga/xtask/Cargo.toml -- --check
|
2021-09-28 15:25:33 +00:00
|
|
|
|
2024-10-04 14:57:23 +00:00
|
|
|
- name: Install Taplo
|
|
|
|
uses: uncenter/setup-taplo@v1
|
|
|
|
with:
|
|
|
|
version: "0.9.3"
|
|
|
|
|
|
|
|
- name: run `taplo fmt`
|
|
|
|
run: taplo format --check --diff
|
|
|
|
|
2024-02-05 17:30:29 +00:00
|
|
|
- name: Check for typos
|
2024-11-11 09:06:15 +00:00
|
|
|
uses: crate-ci/typos@v1.27.3
|
2024-02-05 17:30:29 +00:00
|
|
|
|
2023-10-04 01:03:32 +00:00
|
|
|
check-cts-runner:
|
2024-01-13 11:26:55 +00:00
|
|
|
# runtime is normally 2 minutes
|
|
|
|
timeout-minutes: 10
|
|
|
|
|
2022-10-15 02:55:36 +00:00
|
|
|
name: Clippy cts_runner
|
2021-09-28 15:25:33 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout repo
|
2023-09-05 13:27:38 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-09-28 15:25:33 +00:00
|
|
|
|
2023-02-09 15:33:53 +00:00
|
|
|
- name: Install MSRV toolchain
|
|
|
|
run: |
|
2023-10-04 01:03:32 +00:00
|
|
|
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy
|
|
|
|
rustup override set ${{ env.REPO_MSRV }}
|
|
|
|
cargo -V
|
2022-10-15 02:55:36 +00:00
|
|
|
|
|
|
|
- name: disable debug
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir -p .cargo
|
|
|
|
echo """
|
|
|
|
[profile.dev]
|
|
|
|
debug = 1" >> .cargo/config.toml
|
|
|
|
|
|
|
|
- name: caching
|
2024-01-16 16:37:27 +00:00
|
|
|
uses: Swatinem/rust-cache@v2
|
2022-10-15 02:55:36 +00:00
|
|
|
with:
|
2023-10-04 01:03:32 +00:00
|
|
|
key: cts-runner-${{ env.CACHE_SUFFIX }}
|
2021-09-28 15:25:33 +00:00
|
|
|
|
|
|
|
- name: build Deno
|
|
|
|
run: |
|
2022-10-15 02:55:36 +00:00
|
|
|
cargo clippy --manifest-path cts_runner/Cargo.toml
|
2022-11-30 21:46:58 +00:00
|
|
|
|
2023-10-04 01:03:32 +00:00
|
|
|
# Separate job so that new advisories don't block CI.
|
|
|
|
#
|
|
|
|
# This job is not required to pass for PRs to be merged.
|
2022-11-30 21:46:58 +00:00
|
|
|
cargo-deny-check-advisories:
|
2024-01-13 11:26:55 +00:00
|
|
|
# runtime is normally 1 minute
|
|
|
|
timeout-minutes: 5
|
|
|
|
|
2023-10-04 01:03:32 +00:00
|
|
|
name: "cargo-deny advisories"
|
2022-11-30 21:46:58 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout repo
|
2023-09-05 13:27:38 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-11-30 21:46:58 +00:00
|
|
|
|
|
|
|
- name: Run `cargo deny check`
|
2024-08-05 07:00:10 +00:00
|
|
|
uses: EmbarkStudios/cargo-deny-action@v2
|
2022-11-30 21:46:58 +00:00
|
|
|
with:
|
|
|
|
command: check advisories
|
|
|
|
arguments: --all-features --workspace
|
2023-10-04 01:03:32 +00:00
|
|
|
rust-version: ${{ env.REPO_MSRV }}
|
2022-11-30 21:46:58 +00:00
|
|
|
|
|
|
|
cargo-deny-check-rest:
|
2024-01-13 11:26:55 +00:00
|
|
|
# runtime is normally 1 minute
|
|
|
|
timeout-minutes: 5
|
2024-02-27 19:43:05 +00:00
|
|
|
|
2023-10-04 01:03:32 +00:00
|
|
|
name: "cargo-deny"
|
2022-11-30 21:46:58 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout repo
|
2023-09-05 13:27:38 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-11-30 21:46:58 +00:00
|
|
|
|
|
|
|
- name: Run `cargo deny check`
|
2024-08-05 07:00:10 +00:00
|
|
|
uses: EmbarkStudios/cargo-deny-action@v2
|
2022-11-30 21:46:58 +00:00
|
|
|
with:
|
|
|
|
command: check bans licenses sources
|
|
|
|
arguments: --all-features --workspace
|
2023-10-04 01:03:32 +00:00
|
|
|
rust-version: ${{ env.REPO_MSRV }}
|