Use rust-enabled pre-commit configuration. #83
Workflow file for this run
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: pre-commit | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
push: | |
branches: | |
- "*" | |
workflow_dispatch: | |
env: | |
RUST_VERSION: 1.78.0 | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- 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/[email protected] | |
with: | |
path: | | |
~/.cache/pre-commit/ | |
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
- uses: actions/[email protected] | |
with: | |
python-version: '3.12' | |
- name: Install pre-commit | |
run: pip install -r .github/workflows/pre-commit-requirements.txt | |
- name: Run pre-commit | |
run: pre-commit run --all-files | |
- run: df -h | |
if: always() |