Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: move from make to cargo xtask workflows #2297

Merged
merged 3 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
xtask = "run --manifest-path xtask/Cargo.toml --"
14 changes: 10 additions & 4 deletions .github/workflows/validation-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- 'tests/out/dot/*.dot'
- 'tests/out/wgsl/*.wgsl'
- 'src/front/wgsl/*'
- 'xtask/**'

jobs:
validate-linux:
Expand All @@ -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
8 changes: 7 additions & 1 deletion .github/workflows/validation-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
paths:
- '.github/workflows/validation-macos.yml'
- 'tests/out/msl/*.msl'
- 'xtask/**'

jobs:
validate-macos:
Expand All @@ -12,4 +13,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- run: make validate-msl
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
xtask -> target

- run: cargo xtask validate msl
18 changes: 14 additions & 4 deletions .github/workflows/validation-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
paths:
- '.github/workflows/validation-windows.yml'
- 'tests/out/hlsl/*.hlsl'
- 'tests/out/hlsl/*.ron'
- 'xtask/**'

jobs:
validate-windows-dxc:
Expand All @@ -15,8 +17,12 @@ jobs:
- name: Add DirectXShaderCompiler
uses: napokue/setup-dxc@v1.1.0

- run: make validate-hlsl-dxc
shell: sh
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
xtask -> target

- run: cargo xtask validate hlsl dxc

validate-windows-fxc:
name: HLSL via FXC
Expand All @@ -33,5 +39,9 @@ jobs:
| Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
shell: powershell

- run: make validate-hlsl-fxc
shell: sh
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
xtask -> target

- run: cargo xtask validate hlsl fxc
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ unicode-xid = { version = "0.2.3", optional = true }
bincode = "1"
criterion = { version = "0.3", features = [] }
diff = "0.1"
env_logger = "0.9"
hlsl-snapshots = { path = "./xtask/hlsl-snapshots"}
# Require at least version 0.7.1 of ron, this version changed how floating points are
# serialized by forcing them to always have the decimal part, this makes it backwards
# incompatible with our tests because we do a syntatic diff and not a semantic one.
ron = "~0.7.1"
rspirv = { version = "0.11", git = "https://github.com/gfx-rs/rspirv", rev = "b969f175d5663258b4891e44b76c1544da9661ab" }
serde = { version = "1.0", features = ["derive"] }
spirv = { version = "0.2", features = ["deserialize"] }
rspirv = { version = "0.11", git = "https://github.com/gfx-rs/rspirv", rev = "b969f175d5663258b4891e44b76c1544da9661ab" }
env_logger = "0.9"

[workspace]
members = [".", "cli"]
Expand Down
131 changes: 0 additions & 131 deletions Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tests/out/hlsl/access.hlsl.config

This file was deleted.

20 changes: 20 additions & 0 deletions tests/out/hlsl/access.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(
vertex:[
(
entry_point:"foo_vert",
target_profile:"vs_5_1",
),
],
fragment:[
(
entry_point:"foo_frag",
target_profile:"ps_5_1",
),
],
compute:[
(
entry_point:"assign_through_ptr",
target_profile:"cs_5_1",
),
],
)
3 changes: 0 additions & 3 deletions tests/out/hlsl/array-in-ctor.hlsl.config

This file was deleted.

12 changes: 12 additions & 0 deletions tests/out/hlsl/array-in-ctor.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(
vertex:[
],
fragment:[
],
compute:[
(
entry_point:"cs_main",
target_profile:"cs_5_1",
),
],
)
3 changes: 0 additions & 3 deletions tests/out/hlsl/atomicOps.hlsl.config

This file was deleted.

12 changes: 12 additions & 0 deletions tests/out/hlsl/atomicOps.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(
vertex:[
],
fragment:[
],
compute:[
(
entry_point:"cs_main",
target_profile:"cs_5_1",
),
],
)
3 changes: 0 additions & 3 deletions tests/out/hlsl/binding-arrays.hlsl.config

This file was deleted.

12 changes: 12 additions & 0 deletions tests/out/hlsl/binding-arrays.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(
vertex:[
],
fragment:[
(
entry_point:"main",
target_profile:"ps_5_1",
),
],
compute:[
],
)
3 changes: 0 additions & 3 deletions tests/out/hlsl/bitcast.hlsl.config

This file was deleted.

12 changes: 12 additions & 0 deletions tests/out/hlsl/bitcast.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(
vertex:[
],
fragment:[
],
compute:[
(
entry_point:"main",
target_profile:"cs_5_1",
),
],
)
3 changes: 0 additions & 3 deletions tests/out/hlsl/boids.hlsl.config

This file was deleted.

12 changes: 12 additions & 0 deletions tests/out/hlsl/boids.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(
vertex:[
],
fragment:[
],
compute:[
(
entry_point:"main",
target_profile:"cs_5_1",
),
],
)
3 changes: 0 additions & 3 deletions tests/out/hlsl/break-if.hlsl.config

This file was deleted.

12 changes: 12 additions & 0 deletions tests/out/hlsl/break-if.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(
vertex:[
],
fragment:[
],
compute:[
(
entry_point:"main",
target_profile:"cs_5_1",
),
],
)
3 changes: 0 additions & 3 deletions tests/out/hlsl/collatz.hlsl.config

This file was deleted.

12 changes: 12 additions & 0 deletions tests/out/hlsl/collatz.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(
vertex:[
],
fragment:[
],
compute:[
(
entry_point:"main",
target_profile:"cs_5_1",
),
],
)
3 changes: 0 additions & 3 deletions tests/out/hlsl/control-flow.hlsl.config

This file was deleted.

12 changes: 12 additions & 0 deletions tests/out/hlsl/control-flow.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(
vertex:[
],
fragment:[
],
compute:[
(
entry_point:"main",
target_profile:"cs_5_1",
),
],
)
Loading