Skip to content

cfg: reuse original ControlRegions as much as possible during structurization. #319

cfg: reuse original ControlRegions as much as possible during structurization.

cfg: reuse original ControlRegions as much as possible during structurization. #319

Workflow file for this run

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:
# HACK(eddyb) only nightly supports setting `version = "Two"`
# in `rustfmt.toml`, which is needed to format array/slice patterns
# at all (see https:/rust-lang/rustfmt/pull/4994).
toolchain: nightly
override: true
# 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:/EmbarkStudios/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:/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@v1
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