-
Notifications
You must be signed in to change notification settings - Fork 14
40 lines (30 loc) · 947 Bytes
/
validation.yml
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
name: Validation
on: [pull_request, workflow_dispatch]
jobs:
validation:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit
- name: Cache for pre-commit
id: cache-pre-commit
uses: actions/cache@v3
env:
cache-name: pre-commit-environment
with:
# pre-commit cache files are stored in `~/.cache/pre-commit` by default
path: ~/.cache/pre-commit
key: ${{ runner.os }}_${{ env.cache-name }}
restore-keys: |
- ${{ runner.os }}_${{ env.cache-name }}
- ${{ env.cache-name }}
- name: Run pre-commit hooks
run: pre-commit run --all-files --show-diff-on-failure --color=always