Merge branch 'dangerjs/cache_npm' into 'master'

ci(danger): Add DangerJS npm modules cache

See merge request espressif/esp-idf!23189
pull/11275/head
Tomas Sebestik 2023-04-19 15:13:57 +08:00
commit 129defda84
6 zmienionych plików z 1774 dodań i 4 usunięć

Wyświetl plik

@ -112,6 +112,7 @@ cache:
- .cache/submodule_archives
policy: pull
.common_before_scripts: &common-before_scripts |
source tools/ci/utils.sh
is_based_on_commits $REQUIRED_ANCESTOR_COMMITS

Wyświetl plik

@ -28,18 +28,27 @@ check_pre_commit_MR:
check_MR_style_dangerjs:
extends:
- .pre_check_template
image: node:14.18.0-alpine3.14
image: node:18.15.0-alpine3.16
variables:
DANGER_GITLAB_API_TOKEN: ${ESPCI_TOKEN}
DANGER_GITLAB_HOST: ${GITLAB_HTTP_SERVER}
DANGER_GITLAB_API_BASE_URL: ${GITLAB_HTTP_SERVER}/api/v4
DANGER_JIRA_USER: ${DANGER_JIRA_USER}
DANGER_JIRA_PASSWORD: ${DANGER_JIRA_PASSWORD}
cache:
# pull only for most of the use cases since it's cache dir.
# Only set "push" policy for "upload_cache" stage jobs
key:
files:
- .gitlab/dangerjs/package-lock.json
paths:
- .gitlab/dangerjs/node_modules/
policy: pull
before_script:
- npm install -g danger@11.2.3 --silent --no-progress > /dev/null
- npm install axios@1.3.3 --silent --no-progress > /dev/null
- cd .gitlab/dangerjs
- npm install --no-progress --no-update-notifier # Install danger dependencies
script:
- danger ci --dangerfile=".gitlab/dangerjs/dangerfile.js" --failOnErrors -v
- npx danger ci --failOnErrors -v
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

Wyświetl plik

@ -199,6 +199,9 @@
- "components/bt/controller/lib_esp32c6/esp32c6-bt-lib"
- ".gitmodules"
.patterns-danger-npm: &patterns-danger-npm
- ".gitlab/dangerjs/package-lock.json"
# for jobs: example_test*flash_encryption_wifi_high_traffic
.patterns-example_test-ota-nightly_run: &patterns-example_test-ota-nightly_run
- "examples/system/ota/**/*"
@ -387,6 +390,13 @@
- <<: *if-dev-push
changes: *patterns-submodule
.rules:patterns:dangerjs:
rules:
- <<: *if-label-upload_cache
when: manual
- <<: *if-dev-push
changes: *patterns-danger-npm
.rules:dev:
rules:
- <<: *if-trigger

Wyświetl plik

@ -48,3 +48,27 @@ upload-submodules-cache:
parallel:
matrix:
- GEO: [ 'shiny', 'brew' ]
upload-danger-npm-cache:
stage: upload_cache
image: node:18.15.0-alpine3.16
extends:
- .rules:patterns:dangerjs
tags:
- $GEO
- cache
cache:
key:
files:
- .gitlab/dangerjs/package-lock.json
paths:
- .gitlab/dangerjs/node_modules/
policy: push
before_script:
- echo "Skip before scripts ...."
script:
- cd .gitlab/dangerjs
- npm install --no-progress --no-update-notifier
parallel:
matrix:
- GEO: [ 'shiny', 'brew' ]

1715
.gitlab/dangerjs/package-lock.json wygenerowano 100644

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1,11 @@
{
"name": "dangerjs-esp-idf",
"description": "Merge request automatic linter",
"main": "dangerfile.js",
"dependencies": {
"danger": "^11.2.3",
"axios": "^1.3.3",
"langchain": "^0.0.53",
"openai-gpt-token-counter": "^1.0.3"
}
}