Skip to content

ci: adopt install-cargo-tool fallback and pinned taplo-cli from windows-drivers-rs #883

ci: adopt install-cargo-tool fallback and pinned taplo-cli from windows-drivers-rs

ci: adopt install-cargo-tool fallback and pinned taplo-cli from windows-drivers-rs #883

name: Code Formatting Check
on:
push:
pull_request:
merge_group:
schedule: # Trigger a job on default branch at 4AM PST everyday
- cron: 0 11 * * *
concurrency:
group: ${{ github.workflow }}-${{ github.event.compare || github.head_ref || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
cargo-fmt:
name: .rs Formatting Check
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain (Nightly)
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Run Cargo Format
run: cargo +nightly fmt --all -- --check
taplo-fmt:
name: .toml Formatting Check
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Checkout windows-drivers-rs actions
uses: actions/checkout@v4
with:
repository: microsoft/windows-drivers-rs
ref: main
path: _temp/windows-drivers-rs
sparse-checkout: |
.github/actions
sparse-checkout-cone-mode: false
- name: Copy actions to workspace
shell: pwsh
run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/
- name: Install Rust Toolchain (Stable)
uses: dtolnay/rust-toolchain@stable
- name: Install taplo-cli
uses: ./.github/actions/install-cargo-tool
with:
tool: taplo-cli
- run: taplo fmt --check --diff
name: Check TOML files formatting