mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 09:09:10 -04:00
ci(danger): add DangerJS npm modules cache
This commit is contained in:
parent
98849634b3
commit
1946f5c488
@ -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
|
||||
|
@ -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"'
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
generated
Normal file
1715
.gitlab/dangerjs/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
11
.gitlab/dangerjs/package.json
Normal file
11
.gitlab/dangerjs/package.json
Normal file
@ -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"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user