Skip to content

Generate logging level enums as newtype instead of Rust enum #142

Generate logging level enums as newtype instead of Rust enum

Generate logging level enums as newtype instead of Rust enum #142

Workflow file for this run

on:
push:
pull_request:
jobs:
rust:
name: Lint Rust code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Cargo fmt
run: cargo fmt --all -- --check
- name: Cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Cargo test
run: cargo test --workspace
rust-msrv:
name: Build-test MSRV (1.74) with minimal crate dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
- name: Generate minimal-version dependencies
run: cargo -Zminimal-versions generate-lockfile
- uses: dtolnay/rust-toolchain@1.74.0
- name: Cargo check
run: cargo check --workspace --all-targets
generate-rust:
name: Generate Rust crate
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Checkout submodule
# Manually update submodules with --checkout because they are configured with update=none and will be skipped otherwise
run: git submodule update --recursive --init --force --checkout
- name: Install Vulkan SDK
# Normally the installer sets the VULKAN_SDK system environment variable to the installation location. GitHub Actions does not reimport
# this change in variables, requiring us to change it to known location intead and output the location ourselves below.
run: winget install --accept-package-agreements --accept-source-agreements -e KhronosGroup.VulkanSDK --location C:\VulkanSDK
- name: Make VULKAN_SDK environment variable available
run: echo "VULKAN_SDK=C:\VulkanSDK" >> $env:GITHUB_ENV
- name: Clean
shell: bash
run: >
rm
src/xefg_swapchain/dx12.rs
src/xefg_swapchain/swapchain.rs
src/xell/dx12.rs
src/xell/xell.rs
src/xess/dx11.rs
src/xess/dx12.rs
src/xess/vk.rs
src/xess/xess.rs
- name: Generate
run: cargo b -Fgenerate-bindings
- name: Upload crate source
uses: actions/upload-artifact@v6
with:
name: crate-source
path: src/
- name: Diff generated Rust code
shell: bash
run: test -z "$(git status --porcelain)" || (echo "::error::Generated files are different, please regenerate with cargo b -Fgenerate-bindings!"; git status; false)