build: move from make to cargo xtask workflows

Re-implement `naga` development workflows using [`cargo xtask`]. Convert
`make` logic and shader test configuration as file with Bash variables
into an `xtask` crate and YAML files, respectively.

Pros:

* We now have a _portable_ workflow everywhere, which means Windows
  folks and people who don't install `make` don't have to suffer.
  😮‍💨
* Workflow logic is now relatively easy to inspect and change. Whew!
  💁🏻‍♂️💦
* Contributors can use their existing Rust knowledge to contribute to
  developer experience. 🎉
* `cargo xtask` is a relatively well-known convention for workflows in
  the ecosystem.
* We can do fancy things like allow folks to run at different log levels
  for workflows, depending on their tastes.

Cons:

* There's now a non-trivial compile step to project workflow.
  Incremental rebuilds seem to be pretty short, though!
* Code is much more verbose than the (very) terse `make` implementation.

[`cargo xtask`]: https://github.com/matklad/cargo-xtask
This commit is contained in:
Erich Gubler authored and Teodor Tanasoaia committed 2023-06-08 16:56:57 +02:00
1 parent e8a7e50f0f
commit 91d48b2923
83 files changed
+1389 -277

No files matched your search

+10 -4
View File
@@ -8,6 +8,7 @@ on:
- 'tests/out/dot/*.dot'
- 'tests/out/wgsl/*.wgsl'
- 'src/front/wgsl/*'
- 'xtask/**'
jobs:
validate-linux:
@@ -19,10 +20,15 @@ jobs:
- name: Install tools
run: sudo apt-get install spirv-tools glslang-tools graphviz
- run: make validate-spv
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
xtask -> target
- run: make validate-glsl
- run: cargo xtask validate spv
- run: make validate-dot
- run: cargo xtask validate glsl
- run: make validate-wgsl
- run: cargo xtask validate dot
- run: cargo xtask validate wgsl