2024-05-06 05:58:55 +00:00
|
|
|
name: Pre-commit hooks
|
2024-11-20 08:40:13 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2024-05-06 05:58:55 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
precommit:
|
|
|
|
name: Pre-commit
|
|
|
|
env:
|
|
|
|
# Skip pre-commit hooks which are executed by other actions.
|
|
|
|
SKIP: make-lint,go-staticcheck-repo-mod,go-unit-tests,gofumpt
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
# If we use actions/setup-python from either Github or Gitea,
|
2024-07-01 15:58:37 +00:00
|
|
|
# the line above fails with a cryptic error about not being able to find python.
|
2024-05-06 05:58:55 +00:00
|
|
|
# So install everything manually.
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
2024-08-20 12:35:45 +00:00
|
|
|
go-version: 1.23
|
2024-05-06 05:58:55 +00:00
|
|
|
- name: Set up Python
|
|
|
|
run: |
|
|
|
|
apt update
|
|
|
|
apt install -y pre-commit
|
|
|
|
- name: Run pre-commit
|
|
|
|
run: pre-commit run --color=always --hook-stage manual --all-files
|