Enable WebGPU CTS on CI

This commit is contained in:
Dzmitry Malyshau 2021-09-03 13:53:10 -04:00 committed by Dzmitry Malyshau
parent 8080a3c6da
commit bbb9968297
4 changed files with 56 additions and 28 deletions

View File

@ -66,7 +66,7 @@ jobs:
target: wasm32-unknown-unknown target: wasm32-unknown-unknown
kind: webgl kind: webgl
name: ${{ matrix.name }} name: Check ${{ matrix.name }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
env: env:
@ -138,7 +138,7 @@ jobs:
if: matrix.kind == 'test' if: matrix.kind == 'test'
run: | run: |
cargo build --target ${{ matrix.target }} --bin wgpu-info cargo build --target ${{ matrix.target }} --bin wgpu-info
cargo build --target ${{ matrix.target }} --tests --workspace --exclude wgpu cargo build --target ${{ matrix.target }} --tests -p wgpu-types -p wgpu-hal -p wgpu-core
cargo build --target ${{ matrix.target }} --examples --tests -p wgpu cargo build --target ${{ matrix.target }} --examples --tests -p wgpu
- name: tests - name: tests
@ -146,12 +146,48 @@ jobs:
run: | run: |
# run wgpu-info # run wgpu-info
cargo run --target ${{ matrix.target }} --bin wgpu-info cargo run --target ${{ matrix.target }} --bin wgpu-info
# run player tests # run player tests
cargo test --target ${{ matrix.target }} --workspace --exclude wgpu --no-fail-fast -- --nocapture cargo test --target ${{ matrix.target }} -p wgpu-types -p wgpu-hal -p wgpu-core --no-fail-fast -- --nocapture
# run coretests # run coretests
cargo run --target ${{ matrix.target }} --bin wgpu-info -- cargo test --target ${{ matrix.target }} -p wgpu --no-fail-fast -- --nocapture --test-threads=1 # GLES is currently non-multithreadable cargo run --target ${{ matrix.target }} --bin wgpu-info -- cargo test --target ${{ matrix.target }} -p wgpu --no-fail-fast -- --nocapture
test:
strategy:
fail-fast: false
matrix:
include:
# Windows
- name: Windows x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
name: Test ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: checkout repo
uses: actions/checkout@v2
with:
path: wgpu
- name: checkout cts
uses: actions/checkout@v2
with:
repository: gpuweb/cts
ref: 8dbacc65e37f2c0d1a5c4adbb2f6ca363fe2f459 # from "gh-pages" branch
path: cts
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
profile: minimal
- name: build CTS runner
run: cd wgpu && cargo build -p cts_runner
- name: run CTS
run: cd cts && ../wgpu/target/debug/cts_runner.exe ./tools/run_deno --verbose 'unittests:*'
fmt: fmt:
name: Format name: Format

View File

@ -19,13 +19,3 @@ deno_webidl = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a
deno_webgpu = { path = "../deno_webgpu" } deno_webgpu = { path = "../deno_webgpu" }
tokio = { version = "1.10.0", features = ["full"] } tokio = { version = "1.10.0", features = ["full"] }
termcolor = "1.1.2" termcolor = "1.1.2"
[build-dependencies]
deno_console = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" }
deno_core = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" }
deno_timers = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" }
deno_url = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" }
deno_web = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" }
deno_webidl = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a997809f02b18c2ba1ecd58d" }
deno_webgpu = { path = "../deno_webgpu" }
tokio = { version = "1.10.0", features = ["full"] }

View File

@ -1,7 +1,8 @@
use std::fmt; use std::{
use std::io::Read; env, fmt,
use std::io::Write; io::{Read, Write},
use std::rc::Rc; rc::Rc,
};
use deno_core::error::anyhow; use deno_core::error::anyhow;
use deno_core::error::AnyError; use deno_core::error::AnyError;
@ -25,11 +26,12 @@ async fn main() {
} }
async fn run() -> Result<(), AnyError> { async fn run() -> Result<(), AnyError> {
let args = std::env::args().collect::<Vec<_>>(); let mut args_iter = env::args();
let url = args let _ = args_iter.next();
.get(1) let url = args_iter
.next()
.ok_or_else(|| anyhow!("missing specifier in first command line argument"))?; .ok_or_else(|| anyhow!("missing specifier in first command line argument"))?;
let specifier = resolve_url_or_path(url)?; let specifier = resolve_url_or_path(&url)?;
let options = RuntimeOptions { let options = RuntimeOptions {
module_loader: Some(Rc::new(deno_core::FsModuleLoader)), module_loader: Some(Rc::new(deno_core::FsModuleLoader)),
@ -46,8 +48,8 @@ async fn run() -> Result<(), AnyError> {
..Default::default() ..Default::default()
}; };
let mut isolate = JsRuntime::new(options); let mut isolate = JsRuntime::new(options);
let args: Vec<String> = std::env::args().skip(2).collect(); let args = args_iter.collect::<Vec<String>>();
let cfg = json!({"args": args, "cwd": std::env::current_dir().unwrap().to_string_lossy() }); let cfg = json!({"args": args, "cwd": env::current_dir().unwrap().to_string_lossy() });
let bootstrap_script = format!("globalThis.bootstrap({})", serde_json::to_string(&cfg)?); let bootstrap_script = format!("globalThis.bootstrap({})", serde_json::to_string(&cfg)?);
isolate.execute_script(&located_script_name!(), &bootstrap_script)?; isolate.execute_script(&located_script_name!(), &bootstrap_script)?;

View File

@ -7,7 +7,7 @@ authors = ["the Deno authors"]
edition = "2018" edition = "2018"
license = "MIT" license = "MIT"
readme = "README.md" readme = "README.md"
repository = "https://github.com/denoland/deno" repository = "https://github.com/gfx-rs/wgpu"
description = "WebGPU implementation for Deno" description = "WebGPU implementation for Deno"
[lib] [lib]
@ -18,4 +18,4 @@ deno_core = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a0a
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1.10", features = ["full"] } tokio = { version = "1.10", features = ["full"] }
wgpu-core = { path = "../wgpu-core", features = ["trace", "replay", "serde"] } wgpu-core = { path = "../wgpu-core", features = ["trace", "replay", "serde"] }
wgpu-types = { path = "../wgpu-types", features = ["trace", "replay", "serde"] } wgpu-types = { path = "../wgpu-types", features = ["trace", "replay", "serde"] }