-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pre-commit: make hooks self contained + ci config #11226
Changes from all commits
21aba10
f6d9ff4
0e449ca
77bfb53
d50f61e
7f7b65d
19851bb
bc21433
0faa805
ff48144
37d824f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
--- | ||
yamllint: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
variables: | ||
LANG: C.UTF-8 | ||
script: | ||
- yamllint --strict . | ||
except: ['triggers', 'master'] | ||
generate-pre-commit: | ||
image: 'mikefarah/yq@sha256:bcb889a1f9bdb0613c8a054542d02360c2b1b35521041be3e1bd8fbd0534d411' | ||
stage: build | ||
before_script: [] | ||
script: | ||
- > | ||
yq -r < .pre-commit-config.yaml '.repos[].hooks[].id' | | ||
sed 's/^/ - /' | | ||
cat .gitlab-ci/pre-commit-dynamic-stub.yml - > pre-commit-generated.yml | ||
artifacts: | ||
paths: | ||
- pre-commit-generated.yml | ||
|
||
run-pre-commit: | ||
stage: unit-tests | ||
trigger: | ||
include: | ||
- artifact: pre-commit-generated.yml | ||
job: generate-pre-commit | ||
strategy: depend | ||
Comment on lines
+2
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome, that's nice factoring and a way to keep the jobs running in parallel! |
||
|
||
vagrant-validate: | ||
extends: .job | ||
|
@@ -19,108 +30,11 @@ vagrant-validate: | |
- ./tests/scripts/vagrant-validate.sh | ||
except: ['triggers', 'master'] | ||
|
||
ansible-lint: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
script: | ||
- ansible-lint -v | ||
except: ['triggers', 'master'] | ||
|
||
jinja-syntax-check: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
script: | ||
- "find -name '*.j2' -exec tests/scripts/check-templates.py {} +" | ||
except: ['triggers', 'master'] | ||
|
||
syntax-check: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
variables: | ||
ANSIBLE_INVENTORY: inventory/local-tests.cfg | ||
ANSIBLE_REMOTE_USER: root | ||
ANSIBLE_BECOME: "true" | ||
ANSIBLE_BECOME_USER: root | ||
ANSIBLE_VERBOSITY: "3" | ||
script: | ||
- ansible-playbook --syntax-check cluster.yml | ||
- ansible-playbook --syntax-check playbooks/cluster.yml | ||
- ansible-playbook --syntax-check upgrade-cluster.yml | ||
- ansible-playbook --syntax-check playbooks/upgrade_cluster.yml | ||
- ansible-playbook --syntax-check reset.yml | ||
- ansible-playbook --syntax-check playbooks/reset.yml | ||
- ansible-playbook --syntax-check extra_playbooks/upgrade-only-k8s.yml | ||
except: ['triggers', 'master'] | ||
|
||
collection-build-install-sanity-check: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
variables: | ||
ANSIBLE_COLLECTIONS_PATH: "./ansible_collections" | ||
script: | ||
- ansible-galaxy collection build | ||
- ansible-galaxy collection install kubernetes_sigs-kubespray-$(grep "^version:" galaxy.yml | awk '{print $2}').tar.gz | ||
- ansible-galaxy collection list $(egrep -i '(name:\s+|namespace:\s+)' galaxy.yml | awk '{print $2}' | tr '\n' '.' | sed 's|\.$||g') | grep "^kubernetes_sigs.kubespray" | ||
- test -f ansible_collections/kubernetes_sigs/kubespray/playbooks/cluster.yml | ||
- test -f ansible_collections/kubernetes_sigs/kubespray/playbooks/reset.yml | ||
except: ['triggers', 'master'] | ||
|
||
tox-inventory-builder: | ||
stage: unit-tests | ||
tags: [light] | ||
extends: .job | ||
before_script: | ||
- ./tests/scripts/rebase.sh | ||
script: | ||
- pip3 install tox | ||
- cd contrib/inventory_builder && tox | ||
except: ['triggers', 'master'] | ||
|
||
markdownlint: | ||
stage: unit-tests | ||
tags: [light] | ||
image: node | ||
before_script: | ||
- npm install -g [email protected] | ||
script: | ||
- markdownlint $(find . -name '*.md' | grep -vF './.git') --ignore docs/_sidebar.md --ignore contrib/dind/README.md | ||
|
||
generate-sidebar: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
script: | ||
- scripts/gen_docs_sidebar.sh | ||
- git diff --exit-code | ||
|
||
check-readme-versions: | ||
stage: unit-tests | ||
tags: [light] | ||
image: python:3 | ||
script: | ||
- tests/scripts/check_readme_versions.sh | ||
|
||
# TODO: convert to pre-commit hook | ||
check-galaxy-version: | ||
stage: unit-tests | ||
tags: [light] | ||
image: python:3 | ||
script: | ||
- tests/scripts/check_galaxy_version.sh | ||
|
||
check-typo: | ||
stage: unit-tests | ||
tags: [light] | ||
image: python:3 | ||
script: | ||
- tests/scripts/check_typo.sh | ||
|
||
ci-matrix: | ||
stage: unit-tests | ||
tags: [light] | ||
image: python:3 | ||
script: | ||
- tests/scripts/md-table/test.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
# stub pipeline for dynamic generation | ||
pre-commit: | ||
tags: | ||
- light | ||
image: 'ghcr.io/pre-commit-ci/runner-image@sha256:aaf2c7b38b22286f2d381c11673bec571c28f61dd086d11b43a1c9444a813cef' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it more readable by changing the |
||
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: |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
all | ||
exclude_rule 'MD013' | ||
exclude_rule 'MD029' | ||
rule 'MD007', :indent => 2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
style "#{File.dirname(__FILE__)}/.md_style.rb" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,4 +146,4 @@ server_groups = { | |
# ] | ||
# anti_affinity_policy = "yes" | ||
# } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,4 +106,4 @@ variable "server_groups" { | |
anti_affinity_policy = string | ||
servers = list(string) | ||
})) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,4 +146,4 @@ server_groups = { | |
# ] | ||
# anti_affinity_policy = "yes" | ||
# } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
# OpenStack | ||
|
||
## Known compatible public clouds | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @VannTen
To make the image more readable, is it ok to change the
mikefarah/yq@sha256:bcb889a1f9bdb0613c8a054542d02360c2b1b35521041be3e1bd8fbd0534d411
to
mikefarah/yq:4.44.1-githubaction