Explorar el Código

ci: cache policy is pull-only for most of the jobs

Fu Hanxi hace 3 años
padre
commit
83965c22b7
Se han modificado 2 ficheros con 11 adiciones y 0 borrados
  1. 4 0
      .gitlab-ci.yml
  2. 7 0
      .gitlab/ci/pre_check.yml

+ 4 - 0
.gitlab-ci.yml

@@ -87,8 +87,12 @@ variables:
   CI_PYTHON_CONSTRAINT_FILE: "espidf.constraints.v5.0.txt"
 
 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
 
 .setup_tools_unless_target_test: &setup_tools_unless_target_test |
   if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then

+ 7 - 0
.gitlab/ci/pre_check.yml

@@ -153,6 +153,13 @@ scan_tests:
       - $TEST_APPS_OUTPUT_DIR
       - $COMPONENT_UT_OUTPUT_DIR
     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:
     EXAMPLE_TEST_DIR: ${CI_PROJECT_DIR}/examples
     EXAMPLE_TEST_OUTPUT_DIR: ${CI_PROJECT_DIR}/examples/test_configs