Skip to content

Commit

Permalink
Split yarn validate-ci task
Browse files Browse the repository at this point in the history
  • Loading branch information
malena-ebert-sonarsource authored and sonartech committed Jan 21, 2021
1 parent aed88b2 commit 23b1a93
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ validate_license_change_task:
$CIRRUS_CHANGE_MESSAGE =~ '.*\[update headers\].*'
timeout_in: 180m # Increase timeout, as license changes impact all files, which slows down the analysis considerably.

yarn_check-ci_task:
<<: *TASK_ONLY_DEFAUT_DEPENDING_ON_BUILD_TEMPLATE
timeout_in: 90m
gke_container:
<<: *GKE_CONTAINER_TEMPLATE
cpu: 4
memory: 8Gb
script: |
./private/cirrus/cirrus-env.sh YARN
gradle yarn_check-ci
on_failure:
<<: *REPORTS_JUNIT_ON_FAILURE_TEMPLATE

qa_task:
<<: *TASK_ONLY_DEFAUT_DEPENDING_ON_BUILD_TEMPLATE
gke_container:
Expand Down
12 changes: 12 additions & 0 deletions server/sonar-docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ yarn_run {
// To clean outputs outside of "build" directory:
clean.dependsOn(cleanYarn_run)

"yarn_check-ci" {
// Note that outputs are not relocatable, because contain absolute paths, and that's why inputs are not relativized
['config', 'src'].each {
inputs.dir(it)
}
['package.json', 'yarn.lock', 'tsconfig.json'].each {
inputs.file(it)
}

dependsOn(yarn)
}

"yarn_validate-ci" {
// Note that outputs are not relocatable, because contain absolute paths, and that's why inputs are not relativized
['config', 'src'].each {
Expand Down
3 changes: 2 additions & 1 deletion server/sonar-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
"lint-report": "eslint --ext js,ts,tsx -f json -o eslint-report.json src",
"ts-check": "tsc --noEmit",
"validate": "yarn lint && yarn ts-check && yarn format-check && yarn test",
"validate-ci": "yarn lint-report && yarn ts-check && yarn format-check && yarn test --coverage"
"validate-ci": "yarn lint-report && yarn test --coverage",
"check-ci": "yarn ts-check && yarn format-check"
},
"prettier": {
"jsxBracketSameLine": true,
Expand Down
12 changes: 12 additions & 0 deletions server/sonar-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ yarn_run {
}
build.dependsOn(yarn_run)

"yarn_check-ci" {
// Note that outputs are not relocatable, because contain absolute paths, and that's why inputs are not relativized
['config', 'src'].each {
inputs.dir(it)
}
['package.json', 'yarn.lock', 'tsconfig.json'].each {
inputs.file(it)
}

dependsOn(yarn)
}

"yarn_validate-ci" {
// Note that outputs are not relocatable, because contain absolute paths, and that's why inputs are not relativized
['config', 'src/main/js'].each {
Expand Down
3 changes: 2 additions & 1 deletion server/sonar-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@
"lint-report": "eslint --ext js,ts,tsx -f json -o eslint-report.json src/main/js",
"ts-check": "tsc --noEmit",
"validate": "yarn lint && yarn ts-check && yarn format-check && yarn test",
"validate-ci": "yarn lint-report && yarn ts-check && yarn format-check && yarn test --coverage",
"validate-ci": "yarn lint-report && yarn test --coverage",
"check-ci": "yarn ts-check && yarn format-check",
"precommit": "yarn ts-check && lint-staged"
},
"engines": {
Expand Down

0 comments on commit 23b1a93

Please sign in to comment.