mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 14:56:42 +00:00
fd352ec0f1
* Clean up CI config * Cache Cargo home in CI * Add `Cargo.lock` * Use rust-cache * Don't fail fast * Disable the cache action for self-hosted runners
62 lines
1.5 KiB
YAML
62 lines
1.5 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- '**.md'
|
|
pull_request:
|
|
paths-ignore:
|
|
- '**.md'
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- name: windows-latest
|
|
runs-on: [self-hosted, Windows]
|
|
self-hosted: true
|
|
- name: ubuntu-latest
|
|
runs-on: ubuntu-latest
|
|
self-hosted: false
|
|
- name: macos-latest
|
|
runs-on: macos-latest
|
|
self-hosted: false
|
|
fail-fast: false
|
|
name: ${{ matrix.name }}
|
|
runs-on: ${{ matrix.runs-on }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- run: rustup toolchain install stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
if: ${{ ! matrix.self-hosted }}
|
|
with:
|
|
shared-key: ${{ matrix.name }}
|
|
- name: Build tests
|
|
run: cargo build --profile=CI --verbose --tests
|
|
- name: Run tests
|
|
run: cargo test --profile=CI --verbose
|
|
- name: Build examples
|
|
run: cargo build --profile=CI --verbose --bins
|
|
clippy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- run: rustup toolchain install stable --component clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: ubuntu-latest
|
|
save-if: "false"
|
|
- name: Run clippy check
|
|
run: cargo clippy --profile=CI -- -Dwarnings
|
|
fmt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- run: rustup toolchain install nightly --component rustfmt
|
|
- name: Run fmt check
|
|
run: cargo +nightly fmt --check
|