Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Merge pull request #100 from glotzerlab/dependabot-github_actions-tru… #379

Merge pull request #100 from glotzerlab/dependabot-github_actions-tru…

Merge pull request #100 from glotzerlab/dependabot-github_actions-tru… #379

Workflow file for this run

name: pre-commit
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- trunk
workflow_dispatch:
env:
RUST_VERSION: 1.86.0
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# For unknown reasons, pre-commit fails with error: component download failed for cargo-x86_64-unknown-linux-gnu: could not rename downloaded file ...
# unless we install with rustup first manually.
- name: Update rust
run: rustup install "$RUST_VERSION" --no-self-update && rustup default "${RUST_VERSION}"
- name: Install rustfmt
run: rustup component add rustfmt
- name: Install clippy
run: rustup component add clippy
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
~/.cache/pre-commit/
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
- name: Set up Python environment
uses: glotzerlab/workflows/setup-uv@a36a97114c60241b26217ce92abbb64621ac67c7 # 0.6.0
with:
lockfile: ".github/workflows/pre-commit-requirements.txt"
- name: Run pre-commit
run: pre-commit run --all-files