Migrate xtask to tracel-xtask and update CI workflow #183
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | ||
env: | ||
CARGO_TERM_COLOR: always | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'Cargo.lock' | ||
- '**.rs' | ||
- '**.yml' | ||
- '**.toml' | ||
- '!**.md' | ||
- '!LICENSE-APACHE' | ||
- '!LICENSE-MIT' | ||
pull_request: | ||
types: [opened, synchronize] | ||
paths: | ||
- 'Cargo.lock' | ||
- '**.rs' | ||
- '**.yml' | ||
- '**.toml' | ||
- '!**.md' | ||
- '!LICENSE-APACHE' | ||
- '!LICENSE-MIT' | ||
jobs: | ||
code-quality: | ||
runs-on: ubuntu-24.04 | ||
needs: prepare-checks | ||
strategy: | ||
matrix: | ||
rust: [stable] | ||
include: | ||
- rust: stable | ||
toolchain: stable | ||
steps: | ||
- name: Setup Rust | ||
uses: tracel-ai/github-actions/setup-rust@v1 | ||
with: | ||
rust-toolchain: ${{ matrix.toolchain }} | ||
cache-key: ${{ matrix.rust }}-linux | ||
# -------------------------------------------------------------------------------- | ||
- name: Audit | ||
run: cargo xtask check audit | ||
# -------------------------------------------------------------------------------- | ||
- name: Format | ||
shell: bash | ||
env: | ||
# work around for colors | ||
# see: https://github.com/rust-lang/rustfmt/issues/3385 | ||
TERM: xterm-256color | ||
run: cargo xtask check format | ||
# -------------------------------------------------------------------------------- | ||
- name: Lint | ||
run: cargo xtask check lint | ||
# -------------------------------------------------------------------------------- | ||
- name: Typos | ||
uses: tracel-ai/github-actions/check-typos@v1 | ||
documentation: | ||
runs-on: ubuntu-24.04 | ||
needs: prepare-checks | ||
strategy: | ||
matrix: | ||
rust: [stable] | ||
include: | ||
- rust: stable | ||
toolchain: stable | ||
steps: | ||
- name: Setup Rust | ||
uses: tracel-ai/github-actions/setup-rust@v1 | ||
with: | ||
rust-toolchain: ${{ matrix.toolchain }} | ||
cache-key: ${{ matrix.rust }}-linux | ||
# -------------------------------------------------------------------------------- | ||
- name: Documentation Build | ||
run: cargo xtask doc build | ||
# -------------------------------------------------------------------------------- | ||
- name: Documentation Tests | ||
run: cargo xtask doc tests | ||
linux-std-tests: | ||
runs-on: ubuntu-24.04 | ||
needs: prepare-checks | ||
strategy: | ||
matrix: | ||
rust: [stable, prev] | ||
include: | ||
- rust: stable | ||
toolchain: stable | ||
coverage: --enable-coverage | ||
- rust: prev | ||
toolchain: ${{ needs.prepare-checks.outputs.rust-prev-version }} | ||
steps: | ||
- name: Setup Rust | ||
uses: tracel-ai/github-actions/setup-rust@v1 | ||
with: | ||
rust-toolchain: ${{ matrix.toolchain }} | ||
cache-key: ${{ matrix.rust }}-linux | ||
# -------------------------------------------------------------------------------- | ||
- name: Setup Linux runner | ||
uses: tracel-ai/github-actions/setup-linux@v1 | ||
with: | ||
vulkan-sdk-version: ${{ env.VULKAN_SDK_VERSION }} | ||
mesa-version: ${{ env.MESA_VERSION }} | ||
mesa-ci-build-version: ${{ env.MESA_CI_BINARY_BUILD }} | ||
# -------------------------------------------------------------------------------- | ||
- name: Tests | ||
run: cargo xtask ${{ matrix.coverage }} test --ci |