Skip to content

Update j178/prek-action action to v3 #555

Update j178/prek-action action to v3

Update j178/prek-action action to v3 #555

Workflow file for this run

name: Style
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- trunk
workflow_dispatch:
permissions: {}
env:
name: row
CARGO_TERM_COLOR: always
CLICOLOR: 1
jobs:
cargo-check:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Configure Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.97.1
- name: Cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
cache-bin: false
- run: cargo check --all-targets --all-features
cargo-clippy:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Configure Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.97.1
components: clippy
- name: Cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
cache-bin: false
- run: cargo clippy --all-targets --all-features -- -Dwarnings
cargo-fmt:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Configure Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.97.1
components: rustfmt
- run: cargo fmt --check
prek:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: prek
uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0
with:
prek-version: '0.3.8'
zizmor:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run zizmor
uses: zizmorcore/zizmor-action@6fc4b006235f201fdab3722e17240ab420d580e5 # v0.6.1
with:
advanced-security: false
# This job is used to provide a single requirement for branch merge conditions.
tests_complete:
name: All style checks
if: always()
needs: [cargo-check, cargo-clippy, cargo-fmt, prek, zizmor]
runs-on: ubuntu-24.04
steps:
- run: jq --exit-status 'all(.result == "success")' <<< "${NEEDS}"
env:
NEEDS: ${{ toJson(needs) }}
- run: exit 0