-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (40 loc) · 1.31 KB
/
pre-commit.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
41
42
name: Pre-commit check hooks
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
pre-commit-checks:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Cache pip dependencies
id: cache-pip-dependencies
uses: actions/cache@v2
with:
# Ubuntu-specific, see
# https://github.com/actions/cache/blob/main/examples.md#python---pip
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install fsleyes-plugin-shimming-toolbox
if: steps.cache-pip-dependencies.cache-hit != 'true'
run: |
pip install .
- name: Run pre-commit large file check
run: pre-commit run --all-files check-added-large-files
- name: Run pre-commit Python syntax check
run: pre-commit run --all-files check-ast
- name: Run pre-commit merge conflict string check
run: pre-commit run --all-files check-merge-conflict
- name: Run pre-commit YAML check # for GitHub Actions configs
run: pre-commit run --all-files check-yaml