-
Notifications
You must be signed in to change notification settings - Fork 2
108 lines (100 loc) · 3.46 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
on:
push:
branches:
- main
tags:
- "*"
pull_request:
merge_group:
name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
# FIXME(eddyb) `style_edition = "2024"` in `rustfmt.toml` is what keeps
# this on `nightly`, should switch to `stable` when that stabilizes.
toolchain: nightly
override: false
# run cargo fetch w/ --locked to verify Cargo.lock is up-to-date
- run: cargo fetch --locked
# make sure all code has been formatted with rustfmt
- name: check rustfmt
run: |
rustup component add rustfmt
cargo fmt -- --check --color always
# run clippy to verify we have no warnings
- name: cargo clippy
run: |
rustup component add clippy
cargo clippy --all-targets --all-features -- -D warnings
- name: Ensure compatibility with rust-gpu nightly rust version
run: |
curl -sSL https://github.com/rust-gpu/rust-gpu/raw/main/rust-toolchain.toml | grep -v '^components = ' > rust-toolchain.toml
cargo check --workspace --all-targets
rm rust-toolchain.toml
test:
name: Test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# NOTE(eddyb) this is the simplest way found so far to get `glslang`.
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.250.0
vulkan-components: Glslang SPIRV-Tools
vulkan-use-cache: true
- run: cargo fetch
# FIXME(eddyb) `cargo test` is not even that important yet.
- name: cargo test build
run: cargo build --tests --release --all-targets
- name: cargo test
run: cargo test --release --all-targets
# FIXME(eddyb) actually flesh this out into a whole testing setup
# (see also https://github.com/EmbarkStudios/spirt/issues/7).
- name: Minimal glslang -> SPIR-V -> SPIR-T -> SPIR-V testing
run: |
glslangValidator -V --target-env spirv1.3 -g tests/data/basic.frag.glsl -o tests/data/basic.frag.glsl.dbg.spv
glslangValidator -V --target-env spirv1.3 -g tests/data/debug-printf.vert.glsl -o tests/data/debug-printf.vert.glsl.dbg.spv
cargo run --release --example spv-lower-link-lift tests/data/basic.frag.glsl.dbg.spv
cargo run --release --example spv-lower-link-lift tests/data/debug-printf.vert.glsl.dbg.spv
- if: ${{ runner.os == 'Linux' }}
name: Check examples are up to date
run: .github/workflows/check-examples.sh
deny-check:
name: cargo-deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: EmbarkStudios/cargo-deny-action@v2
publish-check:
name: Publish Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: cargo fetch
- name: cargo publish check
run: cargo publish --dry-run