-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (51 loc) · 1.49 KB
/
pre-commit.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# cspell:words snok, virtualenvs, pydeps, venv, Pylint, pylint
---
env:
POETRY_VERSION: '1.8.2'
PYTHON_VERSION: '3.9'
jobs:
pre-commit:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/setup-python@v3'
with:
python-version: '${{ env.PYTHON_VERSION }}'
- name: 'Cache Poetry Install'
uses: 'actions/cache@v3'
with:
key: 'poetry-${{ env.POETRY_VERSION }}'
path: '${{ runner.home }}/.local/src/python/hooks'
- name: 'Install Poetry'
uses: 'snok/[email protected]'
with:
installer-parallel: true
version: '${{ env.POETRY_VERSION }}'
virtualenvs-create: true
virtualenvs-in-project: true
- id: 'restore-deps'
uses: 'actions/cache/restore@v3'
with:
key: |
pydeps-${{ hashFiles('./src/python/hooks/poetry.lock') }}
path: './src/python/hooks/.venv'
- if: |
steps.restore-deps.outputs.cache-hit != 'true'
name: 'Install Dependencies'
run: |
cd ./src/python/hooks
poetry install --no-interaction --no-root
- id: 'save-deps'
uses: 'actions/cache/save@v3'
with:
key: |
pydeps-${{ hashFiles('./src/python/hooks/poetry.lock') }}
path: './src/python/hooks/.venv'
- uses: 'pre-commit/[email protected]'
with:
extra_args: '--all-files --config cfg/pre-commit-config.yaml --verbose'
name: 'pre-commit'
'on':
pull_request: null
workflow_dispatch: null
...