mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-06 06:04:33 +02:00
ci: upload cache only when requirements txt changed
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
stages:
|
stages:
|
||||||
|
- upload_cache
|
||||||
- pre_check
|
- pre_check
|
||||||
- build
|
- build
|
||||||
- assign_test
|
- assign_test
|
||||||
@@ -100,7 +101,7 @@ cache:
|
|||||||
paths:
|
paths:
|
||||||
- .cache/pip
|
- .cache/pip
|
||||||
# pull only for most of the use cases since it's cache dir.
|
# pull only for most of the use cases since it's cache dir.
|
||||||
# Only set "pull-push" policy for "scan_test" since it would **possibly** install all pypi packages
|
# Only set "push" policy for "upload_cache" stage jobs since it would install all pypi packages
|
||||||
policy: pull
|
policy: pull
|
||||||
|
|
||||||
.setup_tools_unless_target_test: &setup_tools_unless_target_test |
|
.setup_tools_unless_target_test: &setup_tools_unless_target_test |
|
||||||
@@ -226,6 +227,7 @@ default:
|
|||||||
|
|
||||||
include:
|
include:
|
||||||
- '.gitlab/ci/rules.yml'
|
- '.gitlab/ci/rules.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_check.yml'
|
- '.gitlab/ci/pre_check.yml'
|
||||||
|
@@ -7,7 +7,11 @@
|
|||||||
tags:
|
tags:
|
||||||
- host_test
|
- host_test
|
||||||
dependencies: []
|
dependencies: []
|
||||||
needs: [] # run host_test jobs immediately
|
needs:
|
||||||
|
- job: upload-pip-cache-shiny
|
||||||
|
optional: true # run host_test jobs immediately, only after upload cache
|
||||||
|
- job: upload-pip-cache-brew
|
||||||
|
optional: true # run host_test jobs immediately, only after upload cache
|
||||||
|
|
||||||
test_nvs_on_host:
|
test_nvs_on_host:
|
||||||
extends: .host_test_template
|
extends: .host_test_template
|
||||||
|
@@ -160,13 +160,6 @@ scan_tests:
|
|||||||
- $TEST_APPS_OUTPUT_DIR
|
- $TEST_APPS_OUTPUT_DIR
|
||||||
- $COMPONENT_UT_OUTPUT_DIR
|
- $COMPONENT_UT_OUTPUT_DIR
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
cache:
|
|
||||||
key: pip-cache
|
|
||||||
paths:
|
|
||||||
- .cache/pip
|
|
||||||
# pull only for most of the use cases since it's cache dir.
|
|
||||||
# Only set "pull-push" policy for "scan_test" since it would **possibly** install all pypi packages
|
|
||||||
policy: pull-push
|
|
||||||
variables:
|
variables:
|
||||||
EXAMPLE_TEST_DIR: ${CI_PROJECT_DIR}/examples
|
EXAMPLE_TEST_DIR: ${CI_PROJECT_DIR}/examples
|
||||||
EXAMPLE_TEST_OUTPUT_DIR: ${CI_PROJECT_DIR}/examples/test_configs
|
EXAMPLE_TEST_OUTPUT_DIR: ${CI_PROJECT_DIR}/examples/test_configs
|
||||||
|
@@ -12,6 +12,10 @@
|
|||||||
- "components/**/Kconfig"
|
- "components/**/Kconfig"
|
||||||
- "components/**/CMakeList.txt"
|
- "components/**/CMakeList.txt"
|
||||||
|
|
||||||
|
.patterns-python-cache: &patterns-python-cache
|
||||||
|
- "tools/requirements.json"
|
||||||
|
- "tools/requirements/requirements.*.txt"
|
||||||
|
|
||||||
.patterns-python-files: &patterns-python-files
|
.patterns-python-files: &patterns-python-files
|
||||||
- ".gitlab/ci/static-code-analysis.yml"
|
- ".gitlab/ci/static-code-analysis.yml"
|
||||||
- "**/*.py"
|
- "**/*.py"
|
||||||
@@ -232,6 +236,11 @@
|
|||||||
rules:
|
rules:
|
||||||
- <<: *if-protected-no_label
|
- <<: *if-protected-no_label
|
||||||
|
|
||||||
|
.rules:patterns:python-cache:
|
||||||
|
rules:
|
||||||
|
- <<: *if-dev-push
|
||||||
|
changes: *patterns-python-cache
|
||||||
|
|
||||||
.rules:dev:
|
.rules:dev:
|
||||||
rules:
|
rules:
|
||||||
- <<: *if-trigger
|
- <<: *if-trigger
|
||||||
|
36
.gitlab/ci/upload_cache.yml
Normal file
36
.gitlab/ci/upload_cache.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
.upload_cache_template:
|
||||||
|
stage: upload_cache
|
||||||
|
image: $ESP_ENV_IMAGE
|
||||||
|
|
||||||
|
.upload_pip_cache_template:
|
||||||
|
extends:
|
||||||
|
- .upload_cache_template
|
||||||
|
- .rules:patterns:python-cache
|
||||||
|
cache:
|
||||||
|
key: pip-cache
|
||||||
|
paths:
|
||||||
|
- .cache/pip
|
||||||
|
# pull only for most of the use cases since it's cache dir.
|
||||||
|
# Only set "push" policy for "upload_cache" stage jobs since it would install all pypi packages
|
||||||
|
policy: push
|
||||||
|
before_script: []
|
||||||
|
script:
|
||||||
|
- source tools/ci/utils.sh
|
||||||
|
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
||||||
|
- source tools/ci/setup_python.sh
|
||||||
|
- rm -rf .cache/pip # clear old packages
|
||||||
|
- $IDF_PATH/tools/idf_tools.py install-python-env --features pytest
|
||||||
|
# TODO: remove this, IDFCI-1207
|
||||||
|
- pip install esptool -c ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
|
||||||
|
|
||||||
|
upload-pip-cache-shiny:
|
||||||
|
extends: .upload_pip_cache_template
|
||||||
|
tags:
|
||||||
|
- shiny
|
||||||
|
- build
|
||||||
|
|
||||||
|
upload-pip-cache-brew:
|
||||||
|
extends: .upload_pip_cache_template
|
||||||
|
tags:
|
||||||
|
- brew
|
||||||
|
- build
|
Reference in New Issue
Block a user