ANA-1928| pre-commit setup #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |