JaxPM/.github/workflows/formatting.yml
Francois Lanusse 844cace3d7 adding caching
2025-06-28 02:41:16 +02:00

43 lines
1 KiB
YAML

name: Code Formatting
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-formatting-pip-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-formatting-pip-
- name: Cache pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pre-commit-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pre-commit isort
- name: Run pre-commit
run: python -m pre_commit run --all-files