-
Notifications
You must be signed in to change notification settings - Fork 3
36 lines (34 loc) · 1.14 KB
/
sanity_checks_for_prs.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
---
name: sanity checks
# merge_group triggers happen in merge queues
# workflow_dispatch triggers happen when a user manually runs the workflow
# pull_request triggers happen when a pull request is updated
on: [merge_group, pull_request, workflow_dispatch]
jobs:
pre-commit:
name: Carry out pre-commit checks
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install pre-commit
run: python -m pip install pre-commit
- name: Cache pre-commit environments
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
pre-commit-3|
- name: Run pre-commit (on all files)
run: pre-commit run --show-diff-on-failure --color=always --all-files
shell: bash
id: Run_pre-commit
# this makes sure we do not accidentally use hooks that need docker on the dev machines
env:
DOCKER_HOST: docker_intentionally_disabled