forked from espressif/esp-idf
ci: update pre_commit jobs
This commit is contained in:
@@ -24,6 +24,7 @@ include:
|
|||||||
- '.gitlab/ci/upload_cache.yml'
|
- '.gitlab/ci/upload_cache.yml'
|
||||||
- '.gitlab/ci/docs.yml'
|
- '.gitlab/ci/docs.yml'
|
||||||
- '.gitlab/ci/static-code-analysis.yml'
|
- '.gitlab/ci/static-code-analysis.yml'
|
||||||
|
- '.gitlab/ci/pre_commit.yml'
|
||||||
- '.gitlab/ci/pre_check.yml'
|
- '.gitlab/ci/pre_check.yml'
|
||||||
- '.gitlab/ci/build.yml'
|
- '.gitlab/ci/build.yml'
|
||||||
- '.gitlab/ci/integration_test.yml'
|
- '.gitlab/ci/integration_test.yml'
|
||||||
|
@@ -103,6 +103,7 @@ fast_template_app:
|
|||||||
- .build_template_app_template
|
- .build_template_app_template
|
||||||
- .rules:build:target_test
|
- .rules:build:target_test
|
||||||
stage: pre_check
|
stage: pre_check
|
||||||
|
tags: [fast_run, shiny]
|
||||||
variables:
|
variables:
|
||||||
BUILD_COMMAND_ARGS: "-p"
|
BUILD_COMMAND_ARGS: "-p"
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
@@ -284,6 +285,7 @@ build_template_app:
|
|||||||
generate_build_child_pipeline:
|
generate_build_child_pipeline:
|
||||||
extends:
|
extends:
|
||||||
- .build_template
|
- .build_template
|
||||||
|
tags: [fast_run, shiny]
|
||||||
dependencies: # set dependencies to null to avoid missing artifacts issue
|
dependencies: # set dependencies to null to avoid missing artifacts issue
|
||||||
needs:
|
needs:
|
||||||
- pipeline_variables
|
- pipeline_variables
|
||||||
|
@@ -34,8 +34,7 @@ gen_integration_pipeline:
|
|||||||
image: ${CI_INTEGRATION_ASSIGN_ENV}
|
image: ${CI_INTEGRATION_ASSIGN_ENV}
|
||||||
stage: assign_test
|
stage: assign_test
|
||||||
cache: []
|
cache: []
|
||||||
tags:
|
tags: [fast_run, shiny]
|
||||||
- assign_test
|
|
||||||
variables:
|
variables:
|
||||||
SUBMODULES_TO_FETCH: "none"
|
SUBMODULES_TO_FETCH: "none"
|
||||||
GIT_LFS_SKIP_SMUDGE: 1
|
GIT_LFS_SKIP_SMUDGE: 1
|
||||||
|
@@ -5,18 +5,6 @@
|
|||||||
- host_test
|
- host_test
|
||||||
dependencies: # set dependencies to null to avoid missing artifacts issue
|
dependencies: # set dependencies to null to avoid missing artifacts issue
|
||||||
|
|
||||||
check_pre_commit:
|
|
||||||
extends:
|
|
||||||
- .pre_check_template
|
|
||||||
- .before_script:minimal
|
|
||||||
image: $PRE_COMMIT_IMAGE
|
|
||||||
needs:
|
|
||||||
- pipeline_variables
|
|
||||||
script:
|
|
||||||
- fetch_submodules
|
|
||||||
- pre-commit run --files $MODIFIED_FILES
|
|
||||||
- pre-commit run --hook-stage post-commit validate-sbom-manifest
|
|
||||||
|
|
||||||
check_version:
|
check_version:
|
||||||
# Don't run this for feature/bugfix branches, so that it is possible to modify
|
# Don't run this for feature/bugfix branches, so that it is possible to modify
|
||||||
# esp_idf_version.h in a branch before tagging the next version.
|
# esp_idf_version.h in a branch before tagging the next version.
|
||||||
@@ -142,8 +130,7 @@ pipeline_variables:
|
|||||||
extends:
|
extends:
|
||||||
- .pre_check_template
|
- .pre_check_template
|
||||||
- .before_script:fetch:git_diff
|
- .before_script:fetch:git_diff
|
||||||
tags:
|
tags: [fast_run, shiny]
|
||||||
- build
|
|
||||||
script:
|
script:
|
||||||
# MODIFIED_FILES is a list of files that changed, could be used everywhere
|
# MODIFIED_FILES is a list of files that changed, could be used everywhere
|
||||||
- MODIFIED_FILES=$(echo "$GIT_DIFF_OUTPUT" | xargs)
|
- MODIFIED_FILES=$(echo "$GIT_DIFF_OUTPUT" | xargs)
|
||||||
@@ -174,5 +161,6 @@ pipeline_variables:
|
|||||||
check_test_cases_env_markers_and_required_runners:
|
check_test_cases_env_markers_and_required_runners:
|
||||||
extends:
|
extends:
|
||||||
- .pre_check_template
|
- .pre_check_template
|
||||||
|
tags: [fast_run, shiny]
|
||||||
script:
|
script:
|
||||||
- python tools/ci/dynamic_pipelines/scripts/generate_target_test_child_pipeline.py --check
|
- python tools/ci/dynamic_pipelines/scripts/generate_target_test_child_pipeline.py --check
|
||||||
|
47
.gitlab/ci/pre_commit.yml
Normal file
47
.gitlab/ci/pre_commit.yml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
.check_pre_commit_template:
|
||||||
|
extends:
|
||||||
|
- .before_script:minimal
|
||||||
|
stage: pre_check
|
||||||
|
image: $PRE_COMMIT_IMAGE
|
||||||
|
tags: [cache, shiny]
|
||||||
|
needs:
|
||||||
|
- pipeline_variables
|
||||||
|
variables:
|
||||||
|
# cache pre_commit
|
||||||
|
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit"
|
||||||
|
script:
|
||||||
|
- fetch_submodules
|
||||||
|
- pre-commit run --files $MODIFIED_FILES
|
||||||
|
- pre-commit run --hook-stage post-commit validate-sbom-manifest
|
||||||
|
|
||||||
|
check_pre_commit_upload_cache:
|
||||||
|
extends:
|
||||||
|
- .check_pre_commit_template
|
||||||
|
rules:
|
||||||
|
- if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/) && $CI_PIPELINE_SOURCE == "push"'
|
||||||
|
cache:
|
||||||
|
- key: pre_commit-cache-${LATEST_GIT_TAG}
|
||||||
|
paths:
|
||||||
|
- .cache/pre-commit
|
||||||
|
policy: pull-push
|
||||||
|
- key: submodule-cache-${LATEST_GIT_TAG}
|
||||||
|
paths:
|
||||||
|
- .cache/submodule_archives
|
||||||
|
policy: pull
|
||||||
|
|
||||||
|
check_pre_commit:
|
||||||
|
extends:
|
||||||
|
- .check_pre_commit_template
|
||||||
|
rules:
|
||||||
|
- if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/) && $CI_PIPELINE_SOURCE == "push"'
|
||||||
|
when: never
|
||||||
|
- when: on_success
|
||||||
|
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
|
@@ -1,6 +1,5 @@
|
|||||||
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import inspect
|
import inspect
|
||||||
import typing as t
|
import typing as t
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
@@ -83,7 +82,7 @@ class EmptyJob(Job):
|
|||||||
) -> None:
|
) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
name=name or 'fake_pass_job',
|
name=name or 'fake_pass_job',
|
||||||
tags=tags or ['build', 'shiny'],
|
tags=tags or ['fast_run', 'shiny'],
|
||||||
stage=stage or 'build',
|
stage=stage or 'build',
|
||||||
script=['echo "This is a fake job to pass the pipeline"'],
|
script=['echo "This is a fake job to pass the pipeline"'],
|
||||||
before_script=before_script or [],
|
before_script=before_script or [],
|
||||||
|
Reference in New Issue
Block a user