-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (32 loc) · 1009 Bytes
/
pre-commit.yaml
File metadata and controls
34 lines (32 loc) · 1009 Bytes
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
---
name: "pre-commit"
# yamllint disable-line rule:truthy
on:
push:
branches:
- "*" # Runs on all push events to any branch
pull_request:
branches:
- "*" # Runs on all pull request events targeting any branch
jobs:
pre-commit-job:
runs-on: "ubuntu-24.04"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v5"
- name: "Set up python and pip cache"
uses: "actions/setup-python@v6"
with:
python-version: "3.14.0"
cache: "pip"
- name: "Install python dependencies"
run: "pip install -r requirements.txt"
- name: "Set up pre-commit cache"
uses: "actions/cache@v4"
with:
path: "~/.cache/pre-commit"
# yamllint disable-line rule:line-length
key: "pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}"
- name: "Run pre-commit"
run: "pre-commit run --all-files --color=always --show-diff-on-failure"
...