mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-16 02:30:03 -03:30
Run pre-commit hooks in dynamic pipeline
Use gitlab dynamic child pipelines feature to have one source of truth for the pre-commit jobs, the pre-commit config file. Use one cache per pre-commit. This should reduce the "fetching cache" time steps in gitlab-ci, since each job will have a separate cache with only its hook installed.
This commit is contained in:
17
.gitlab-ci/pre-commit-dynamic-stub.yml
Normal file
17
.gitlab-ci/pre-commit-dynamic-stub.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# stub pipeline for dynamic generation
|
||||
pre-commit:
|
||||
tags:
|
||||
- light
|
||||
image: 'ghcr.io/pre-commit-ci/runner-image@sha256:aaf2c7b38b22286f2d381c11673bec571c28f61dd086d11b43a1c9444a813cef'
|
||||
variables:
|
||||
PRE_COMMIT_HOME: /pre-commit-cache
|
||||
script:
|
||||
- pre-commit run -a $HOOK_ID
|
||||
cache:
|
||||
key: pre-commit-$HOOK_ID
|
||||
paths:
|
||||
- /pre-commit-cache
|
||||
parallel:
|
||||
matrix:
|
||||
- HOOK_ID:
|
||||
Reference in New Issue
Block a user