ash/.github/workflows/ci.yml
Marijn Suijten 4180359ba7
gitmodules: Disable update to prevent cloning on cargo checkout (#808)
When using a `git` reference on this repo, `cargo` will unnecessarily
clone the `Vulkan-Headers` submodule (which is only needed by maintainers
together with the `generator`).  By setting the update mode to `none`
(https://git-scm.com/docs/gitmodules#Documentation/gitmodules.txt-submoduleltnamegtupdate)
this is disabled, and `git submodule update` will now also no longer
fetch/clone/update the repository unless `--checkout` is used
(https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-checkout).

I.e. running `cargo update` on a repo with a `git` dependency on `ash`:

    Updating git repository `https://github.com/ash-rs/ash`
    Skipping git submodule `https://github.com/KhronosGroup/Vulkan-Headers` due to update strategy in .gitmodules
2023-10-30 12:20:28 +01:00

99 lines
3.3 KiB
YAML

on: [push, pull_request]
name: CI
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: cargo check --workspace --all-targets --all-features
check_msrv:
name: Check ash MSRV (1.60.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: dtolnay/rust-toolchain@1.60.0
- run: cargo check -p ash -p ash-rewrite --all-features
check_ash_window_msrv:
name: Check ash-window MSRV (1.64.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: dtolnay/rust-toolchain@1.64.0
- run: cargo check -p ash-window -p examples --all-features
# TODO: add a similar job for the rewrite once that generates code
generated:
name: Generated
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- 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: Run generator
run: cargo run -p generator
- name: Diff autogen result
run: test -z "$(git status --porcelain)" || (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
- name: Test all targets
run: cargo test --workspace --all-targets
- name: Test docs
run: cargo test --workspace --doc
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
- aarch64-apple-ios
steps:
- uses: actions/checkout@v1
- name: Add Rust target ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}
- name: Clippy lint without features
# Only test the core ash, ash-rewrite and ash-window crate, where features reside.
# The examples crate would otherwise enable all default features again,
# making this test moot.
run: cargo clippy --target ${{ matrix.target }} -p ash -p ash-rewrite -p ash-window --no-default-features -- -D warnings
- name: Clippy lint with all features
# Examples don't compile for iOS currently due to lacking run_return()
if: ${{ matrix.target != 'aarch64-apple-ios' }}
run: cargo clippy --target ${{ matrix.target }} --workspace --all-targets --all-features -- -D warnings
- name: Clippy lint with default features
# Examples don't compile for iOS currently due to lacking run_return()
if: ${{ matrix.target != 'aarch64-apple-ios' }}
run: cargo clippy --target ${{ matrix.target }} --workspace --all-targets -- -D warnings
docs:
name: Build-test docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Document all crates
env:
RUSTDOCFLAGS: -Dwarnings
run: cargo doc --all --all-features --no-deps --document-private-items