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
kind: webgl
name: ${{ matrix.name }}
name: Check ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
@ -138,7 +138,7 @@ jobs:
if: matrix.kind == 'test'
run: |
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
- name: tests
@ -146,12 +146,48 @@ jobs:
run: |
# run wgpu-info
cargo run --target ${{ matrix.target }} --bin wgpu-info
# 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
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:
name: Format

View File

@ -19,13 +19,3 @@ deno_webidl = { git = "https://github.com/denoland/deno", rev = "ca75752e5a9499a
deno_webgpu = { path = "../deno_webgpu" }
tokio = { version = "1.10.0", features = ["full"] }
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::io::Read;
use std::io::Write;
use std::rc::Rc;
use std::{
env, fmt,
io::{Read, Write},
rc::Rc,
};
use deno_core::error::anyhow;
use deno_core::error::AnyError;
@ -25,11 +26,12 @@ async fn main() {
}
async fn run() -> Result<(), AnyError> {
let args = std::env::args().collect::<Vec<_>>();
let url = args
.get(1)
let mut args_iter = env::args();
let _ = args_iter.next();
let url = args_iter
.next()
.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 {
module_loader: Some(Rc::new(deno_core::FsModuleLoader)),
@ -46,8 +48,8 @@ async fn run() -> Result<(), AnyError> {
..Default::default()
};
let mut isolate = JsRuntime::new(options);
let args: Vec<String> = std::env::args().skip(2).collect();
let cfg = json!({"args": args, "cwd": std::env::current_dir().unwrap().to_string_lossy() });
let args = args_iter.collect::<Vec<String>>();
let cfg = json!({"args": args, "cwd": env::current_dir().unwrap().to_string_lossy() });
let bootstrap_script = format!("globalThis.bootstrap({})", serde_json::to_string(&cfg)?);
isolate.execute_script(&located_script_name!(), &bootstrap_script)?;

View File

@ -7,7 +7,7 @@ authors = ["the Deno authors"]
edition = "2018"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
repository = "https://github.com/gfx-rs/wgpu"
description = "WebGPU implementation for Deno"
[lib]