-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 1.15 KB
/
pre-commit-ci.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
# This workflow runs pre-commit hooks on pushes and pull requests to main
# to enforce coding style. To ensure correct configuration, please refer to:
# https://lincc-ppt.readthedocs.io/en/latest/practices/ci_precommit.html
name: Run pre-commit hooks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
pre-commit-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade pip
pip install .[dev]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files --verbose
env:
SKIP: "check-lincc-frameworks-template-version,no-commit-to-branch,check-added-large-files,validate-pyproject,sphinx-build,pytest-check"
- uses: pre-commit-ci/lite-action@v1.0.3
if: failure() && github.event_name == 'pull_request' && github.event.pull_request.draft == false