mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 09:09:10 -04:00
ci: update pre_commit jobs
This commit is contained in:
parent
bc7e87b416
commit
b27cf4d444
@ -24,6 +24,7 @@ include:
|
||||
- '.gitlab/ci/upload_cache.yml'
|
||||
- '.gitlab/ci/docs.yml'
|
||||
- '.gitlab/ci/static-code-analysis.yml'
|
||||
- '.gitlab/ci/pre_commit.yml'
|
||||
- '.gitlab/ci/pre_check.yml'
|
||||
- '.gitlab/ci/build.yml'
|
||||
- '.gitlab/ci/integration_test.yml'
|
||||
|
@ -103,6 +103,7 @@ fast_template_app:
|
||||
- .build_template_app_template
|
||||
- .rules:build:target_test
|
||||
stage: pre_check
|
||||
tags: [fast_run, shiny]
|
||||
variables:
|
||||
BUILD_COMMAND_ARGS: "-p"
|
||||
#------------------------------------------------------------------------------
|
||||
@ -284,6 +285,7 @@ build_template_app:
|
||||
generate_build_child_pipeline:
|
||||
extends:
|
||||
- .build_template
|
||||
tags: [fast_run, shiny]
|
||||
dependencies: # set dependencies to null to avoid missing artifacts issue
|
||||
needs:
|
||||
- pipeline_variables
|
||||
|
@ -34,8 +34,7 @@ gen_integration_pipeline:
|
||||
image: ${CI_INTEGRATION_ASSIGN_ENV}
|
||||
stage: assign_test
|
||||
cache: []
|
||||
tags:
|
||||
- assign_test
|
||||
tags: [fast_run, shiny]
|
||||
variables:
|
||||
SUBMODULES_TO_FETCH: "none"
|
||||
GIT_LFS_SKIP_SMUDGE: 1
|
||||
|
@ -5,18 +5,6 @@
|
||||
- host_test
|
||||
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:
|
||||
# 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.
|
||||
@ -142,8 +130,7 @@ pipeline_variables:
|
||||
extends:
|
||||
- .pre_check_template
|
||||
- .before_script:fetch:git_diff
|
||||
tags:
|
||||
- build
|
||||
tags: [fast_run, shiny]
|
||||
script:
|
||||
# MODIFIED_FILES is a list of files that changed, could be used everywhere
|
||||
- MODIFIED_FILES=$(echo "$GIT_DIFF_OUTPUT" | xargs)
|
||||
@ -174,5 +161,6 @@ pipeline_variables:
|
||||
check_test_cases_env_markers_and_required_runners:
|
||||
extends:
|
||||
- .pre_check_template
|
||||
tags: [fast_run, shiny]
|
||||
script:
|
||||
- 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-License-Identifier: Apache-2.0
|
||||
|
||||
import inspect
|
||||
import typing as t
|
||||
from dataclasses import dataclass
|
||||
@ -83,7 +82,7 @@ class EmptyJob(Job):
|
||||
) -> None:
|
||||
super().__init__(
|
||||
name=name or 'fake_pass_job',
|
||||
tags=tags or ['build', 'shiny'],
|
||||
tags=tags or ['fast_run', 'shiny'],
|
||||
stage=stage or 'build',
|
||||
script=['echo "This is a fake job to pass the pipeline"'],
|
||||
before_script=before_script or [],
|
||||
|
Loading…
x
Reference in New Issue
Block a user