feat: Added pre-commit hook of PowerShell scrip checker

This commit is contained in:
Jakub Kocka
2024-04-30 12:36:00 +02:00
parent aa27fbd231
commit 8f383060dd
7 changed files with 45 additions and 17 deletions

View File

@@ -170,6 +170,7 @@
/docs/**/api-reference/system/ @esp-idf-codeowners/system
/docs/**/security/ @esp-idf-codeowners/security
/docs/**/migration-guides/ @esp-idf-codeowners/docs @esp-idf-codeowners/all-maintainers
/docs/**/contribute/install-pre-commit-hook.rst @esp-idf-codeowners/ci @esp-idf-codeowners/tools
/examples/README.md @esp-idf-codeowners/docs @esp-idf-codeowners/ci
/examples/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools

View File

@@ -45,3 +45,36 @@ check_pre_commit:
paths:
- .cache/submodule_archives
policy: pull
check_powershell:
extends:
- .before_script:minimal
stage: pre_check
image: docker:latest
services:
- docker:dind
tags:
- dind
- amd64
needs:
- pipeline_variables
variables:
# cache pre_commit
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit"
rules:
- changes:
- "*.ps1"
script:
- apk add python3
- apk add py3-pip
- pip install pre-commit --break-system-packages
- pre-commit run --hook-stage manual check-powershell-scripts --files $MODIFIED_FILES
cache:
- key: pre_commit-cache-${LATEST_GIT_TAG}
paths:
- .cache/pre-commit
policy: pull
- key: submodule-cache-${LATEST_GIT_TAG}
paths:
- .cache/submodule_archives
policy: pull