ash/.github/workflows/ci.yml
Marijn Suijten e43e9c0c9b
Set MSRV through rust-version in Cargo.toml and validate in CI (#604)
[#590] introduced an unsuspecting MSRV bump.  While we're pro-ba-bly
fine having these at the benefit of better code (in this case more
appropriate `const` annotations), they should at least be clear to us
when merging through a CI failure (or up-front bump of this version in
the CI script).  At the same time setting [`rust-version` in
`Cargo.toml`] provides a more helpful "requires newer rustc" error
message (since Rust 1.56.0) instead of showing potentially tons of
irrelevant compile errors in this crate to the user.

[#590]: https://github.com/MaikKlein/ash/pull/590
[`rust-version` in `Cargo.toml`]: https://doc.rust-lang.org/cargo/reference/manifest.html?highlight=pack#the-rust-version-field
2022-03-27 14:30:10 -07:00

143 lines
3.8 KiB
YAML

on: [push, pull_request]
name: CI
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --all-targets --all-features
check_msrv:
name: Check MSRV (1.59.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: dtolnay/rust-toolchain@1.59.0
- uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --all-targets --all-features
generated:
name: Generated
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Run generator
uses: actions-rs/cargo@v1
with:
command: run
args: -p generator
- name: Format generated results
uses: actions-rs/cargo@v1
with:
command: fmt
args: -p ash
- name: Diff autogen result
run: git diff --quiet || (echo "::error::Generated files are different, please regenerate with cargo run -p generator!"; git diff; false)
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Install Vulkan loader
run: sudo apt-get install libvulkan-dev
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Test all targets
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-targets
- name: Test docs
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --doc
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: actions-rs/cargo@v1
name: Clippy lint without features
with:
command: clippy
# Only test the core ash and ash-window crate, where features reside.
# The examples crate would otherwise enable all default features again,
# making this test moot.
args: -p ash -p ash-window --no-default-features -- -D warnings
- uses: actions-rs/cargo@v1
name: Clippy lint with all features
with:
command: clippy
args: --workspace --all-targets --all-features -- -D warnings
- uses: actions-rs/cargo@v1
name: Clippy lint with default features
with:
command: clippy
args: --workspace --all-targets -- -D warnings
docs:
name: Build-test docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
name: Document all crates
env:
RUSTDOCFLAGS: -Dwarnings
with:
command: doc
args: --all --all-features --no-deps --document-private-items