adding caching

This commit is contained in:
Francois Lanusse 2025-06-28 02:41:16 +02:00
parent 37976c70d8
commit 844cace3d7
2 changed files with 64 additions and 17 deletions

View file

@ -7,15 +7,37 @@ on:
branches: [ "main" ]
jobs:
build:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
- 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 isort
python -m pip install pre-commit
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