Skip to content

Commit 29ea09f

Browse files
committed
Merge branch 'ci/update_pre_commit_job' into 'master'
ci: update pre commit jobs See merge request espressif/esp-idf!40337
2 parents 652fe76 + 3b91d7e commit 29ea09f

File tree

1 file changed

+12
-34
lines changed

1 file changed

+12
-34
lines changed

.gitlab/ci/pre_commit.yml

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,19 @@
33
- .before_script:minimal
44
stage: pre_check
55
image: $PRE_COMMIT_IMAGE
6-
tags: [cache, shiny]
6+
tags: [pre-commit]
7+
variables:
8+
# Both shiny and brew runners can pick this job
9+
GIT_STRATEGY: fetch
10+
GIT_DEPTH: 1
11+
SUBMODULES_TO_FETCH: "all"
712
needs:
813
- pipeline_variables
9-
variables:
10-
# cache pre_commit
11-
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit"
1214
script:
1315
- fetch_submodules
1416
- pre-commit run --files $MODIFIED_FILES
1517
- pre-commit run --hook-stage post-commit validate-sbom-manifest
1618

17-
check_pre_commit_upload_cache:
18-
extends:
19-
- .check_pre_commit_template
20-
rules:
21-
- if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/) && $CI_PIPELINE_SOURCE == "push"'
22-
cache:
23-
- key: pre_commit-cache-${LATEST_GIT_TAG}
24-
paths:
25-
- .cache/pre-commit
26-
policy: pull-push
27-
- key: submodule-cache-${LATEST_GIT_TAG}
28-
paths:
29-
- .cache/submodule_archives
30-
policy: pull
31-
3219
check_pre_commit:
3320
extends:
3421
- .check_pre_commit_template
@@ -37,10 +24,6 @@ check_pre_commit:
3724
when: never
3825
- when: on_success
3926
cache:
40-
- key: pre_commit-cache-${LATEST_GIT_TAG}
41-
paths:
42-
- .cache/pre-commit
43-
policy: pull
4427
- key: submodule-cache-${LATEST_GIT_TAG}
4528
paths:
4629
- .cache/submodule_archives
@@ -56,25 +39,20 @@ check_powershell:
5639
tags:
5740
- dind
5841
- amd64
42+
- brew # faster "apk add"
5943
needs:
6044
- pipeline_variables
6145
variables:
62-
# cache pre_commit
63-
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit"
46+
# brew runners always use fetch
47+
GIT_STRATEGY: fetch
48+
GIT_DEPTH: 1
49+
SUBMODULES_TO_FETCH: "none"
6450
rules:
6551
- changes:
6652
- "*.ps1"
53+
- ".gitlab/ci/pre_commit.yml"
6754
script:
6855
- apk add python3
6956
- apk add py3-pip
7057
- pip install pre-commit --break-system-packages
7158
- pre-commit run --hook-stage manual check-powershell-scripts --files $MODIFIED_FILES
72-
cache:
73-
- key: pre_commit-cache-${LATEST_GIT_TAG}
74-
paths:
75-
- .cache/pre-commit
76-
policy: pull
77-
- key: submodule-cache-${LATEST_GIT_TAG}
78-
paths:
79-
- .cache/submodule_archives
80-
policy: pull

0 commit comments

Comments
 (0)