Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
247 changes: 22 additions & 225 deletions .cirrus.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,25 +191,6 @@ build_task:
- node --version
- regular_mvn_build_deploy_analyze -T1C -Dsonar.skip=true -DartifactoryToken=$ARTIFACTORY_ACCESS_TOKEN -DskipTests

build_eslint_task:
<<: *NODE_RECOMMENDED_CONTAINER_DEFINITION
<<: *NPM_CACHE
<<: *ESLINT_BUILD_CACHE
build_and_deploy_script:
- source cirrus-env BUILD
- node --version
- npm run eslint-plugin:build

knip_task:
<<: *NODE_RECOMMENDED_CONTAINER_DEFINITION
<<: *NPMRC_SCRIPT_DEFINITION
depends_on:
- build
knip_script:
- npm install --no-package-lock
- npm run bbf
- npx knip

test_js_task:
<<: *NODE_RECOMMENDED_CONTAINER_DEFINITION
depends_on:
Expand All @@ -220,7 +201,7 @@ test_js_task:
- source cirrus-env QA
- npm run generate-meta
- npm run bridge:compile
- npm run bridge:test:cov
- npm run bridge:test

test_java_task:
<<: *NODE_RECOMMENDED_CONTAINER_DEFINITION
Expand All @@ -233,89 +214,6 @@ test_java_task:
- source cirrus-env QA
- mvn install -T1C -Pcoverage,coverage-report

analyze_task:
alias: analyze
<<: *NODE_RECOMMENDED_CONTAINER_DEFINITION
depends_on:
- test_js
- test_java
<<: *MAVEN_CACHE
<<: *NPM_CACHE
<<: *JS_COVERAGE_CACHE
<<: *JAVA_COVERAGE_CACHE
matrix:
- name: 'Analyze in SQ NEXT'
env:
SONAR_TOKEN: VAULT[development/kv/data/next data.token]
SONAR_HOST_URL: https://next.sonarqube.com/sonarqube
SONAR_PROJECT_KEY: org.sonarsource.javascript:javascript
- name: 'Analyze in Sonarcloud.io'
only_if: $CIRRUS_CRON == "nightly"
env:
SONAR_TOKEN: VAULT[development/kv/data/sonarcloud data.token]
SONAR_HOST_URL: https://sonarcloud.io
SONAR_PROJECT_KEY: SonarSource_SonarJS
- name: 'Analyze in SonarQube.us'
only_if: $CIRRUS_CRON == "nightly"
env:
SONAR_TOKEN: VAULT[development/kv/data/sonarqube-us data.token]
SONAR_HOST_URL: https://sonarqube.us
SONAR_PROJECT_KEY: SonarSource_SonarJS
analyze_script:
- source cirrus-env BUILD
- PULL_REQUEST_SHA=$GIT_SHA1 regular_mvn_build_deploy_analyze -P-deploy-sonarsource,-release,-sign -Dsonar.organization=sonarsource -Dsonar.projectKey="${SONAR_PROJECT_KEY}" -Dcommercial -Dmaven.shade.skip=true -Dmaven.install.skip=true -Dmaven.deploy.skip=true -DskipTests

run_iris_task:
<<: *CONTAINER_DEFINITION
only_if: $CIRRUS_CRON == "nightly"
depends_on:
- analyze
env:
SONAR_SOURCE_IRIS_TOKEN: VAULT[development/kv/data/iris data.next]
matrix:
- name: 'IRIS SQ NEXT -> Sonarcloud.io'
env:
SONAR_TARGET_URL: https://sonarcloud.io
SONAR_TARGET_IRIS_TOKEN: VAULT[development/kv/data/iris data.sqc-eu]
- name: 'IRIS SQ NEXT -> SonarQube.us'
env:
SONAR_TARGET_URL: https://sonarqube.us
SONAR_TARGET_IRIS_TOKEN: VAULT[development/kv/data/iris data.sqc-us]
script:
- source .cirrus/run-iris.sh

build_win_task:
<<: *WINDOWS_VM_DEFINITION
<<: *ONLY_SONARSOURCE_QA
<<: *NPM_WIN_CACHE
<<: *MAVEN_CACHE
build_script:
- source cirrus-env BUILD
- mvn install -T1C -e -DskipTests

test_js_win_task:
<<: *WINDOWS_VM_DEFINITION
<<: *ONLY_SONARSOURCE_QA
<<: *NPM_WIN_CACHE
depends_on:
- build_win
test_js_script:
- source cirrus-env QA
- npm run generate-meta
- npm run bridge:compile
- npm run bridge:test:js

test_java_win_task:
<<: *WINDOWS_VM_DEFINITION
<<: *ONLY_SONARSOURCE_QA
<<: *NPM_WIN_CACHE
<<: *MAVEN_CACHE
depends_on:
- build_win
test_java_script:
- source cirrus-env QA
- mvn install -T1C

plugin_qa_with_node_task:
alias: plugin_qa_with_node
<<: *MAVEN_CACHE
Expand Down Expand Up @@ -347,77 +245,29 @@ plugin_qa_fast_with_node_task:
# AUTOGENERATED LIST OF NODE VERSIONS BELOW
matrix: # {{FAST_NODE_TASKS}}

plugin_qa_without_node_task:
alias: plugin_qa_without_node
<<: *MAVEN_CACHE
<<: *PLUGIN_QA_BODY
matrix:
- name: 'QA without node on host Ubuntu SQ:LATEST'
<<: *CONTAINER_DEFINITION
<<: *ORCHESTRATOR_CACHE_MONTHLY
env:
SQ_VERSION: LATEST_RELEASE
SONARJS_ARTIFACT: multi
- name: 'QA without node on host Alpine SQ:LATEST'
<<: *ALPINE_CONTAINER_DEFINITION
<<: *ORCHESTRATOR_CACHE_MONTHLY
env:
SQ_VERSION: LATEST_RELEASE
SONARJS_ARTIFACT: linux-x64-musl
- name: 'QA without node on host Ubuntu SQ:DEV'
<<: *CONTAINER_DEFINITION
<<: *ORCHESTRATOR_CACHE
env:
SQ_VERSION: 'DEV'
SONARJS_ARTIFACT: multi

plugin_qa_fast_without_node_task:
alias: plugin_qa_fast_without_node
<<: *MAVEN_CACHE
<<: *PLUGIN_QA_FAST_BODY
env:
# EslintCustomRulesTest requires Node.js in host OS
MVN_TEST: '-Dtest=!EslintCustomRulesTest'
IGNORE_CLASSES: '--projects !org.sonarsource.javascript:eslint-custom-rules-plugin'
matrix:
- name: 'Fast QA without node on host Ubuntu SQ:LATEST'
<<: *CONTAINER_DEFINITION
env:
SQ_VERSION: LATEST_RELEASE
SONARJS_ARTIFACT: multi
- name: 'Fast QA without node on host Alpine SQ:LATEST'
<<: *ALPINE_CONTAINER_DEFINITION
env:
SQ_VERSION: LATEST_RELEASE
SONARJS_ARTIFACT: linux-x64-musl
- name: 'Fast QA without node on host Ubuntu SQ:DEV'
<<: *CONTAINER_DEFINITION
env:
SQ_VERSION: 'DEV'
SONARJS_ARTIFACT: multi

plugin_qa_win_task:
js_ts_ruling_task:
depends_on:
- build
<<: *MAVEN_CACHE
<<: *WINDOWS_VM_DEFINITION
<<: *ONLY_SONARSOURCE_QA
<<: *NODE_RECOMMENDED_CONTAINER_DEFINITION
env:
SQ_VERSION: LATEST_RELEASE
<<: *ORCHESTRATOR_CACHE_MONTHLY
<<: *PLUGIN_QA_BODY

plugin_qa_win_fast_with_node_task:
depends_on:
- build
CIRRUS_CLONE_DEPTH: 1
SONARSOURCE_QA: true
<<: *MAVEN_CACHE
<<: *WINDOWS_VM_DEFINITION
env:
SQ_VERSION: LATEST_RELEASE
MVN_TEST: ''
IGNORE_CLASSES: ''
<<: *PLUGIN_QA_FAST_BODY
<<: *NPM_CACHE
# needed because we need to build the plugin
submodules_script:
- git submodule update --init
ruling_script:
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- npm run build:fast
- npm run ruling
on_failure:
debug_script:
- sh tools/ruling-debug-script.sh packages/ruling/actual/jsts

js_ts_ruling_task:
js_ts_ruling_deno_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
Expand All @@ -434,7 +284,7 @@ js_ts_ruling_task:
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- npm run build:fast
- npm run ruling
- npm run ruling-deno
on_failure:
debug_script:
- sh tools/ruling-debug-script.sh packages/ruling/actual/jsts
Expand All @@ -443,7 +293,7 @@ ruling_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
<<: *CONTAINER_DEFINITION
<<: *NODE_MIN_SUPPORTED_CONTAINER_DEFINITION
env:
CIRRUS_CLONE_DEPTH: 10
SONARSOURCE_QA: true
Expand All @@ -464,7 +314,7 @@ css_ruling_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
<<: *CONTAINER_DEFINITION
<<: *NODE_MIN_SUPPORTED_CONTAINER_DEFINITION
env:
CIRRUS_CLONE_DEPTH: 10
SONARSOURCE_QA: true
Expand All @@ -480,56 +330,3 @@ css_ruling_task:
on_failure:
diff_artifacts:
path: '**/target/actual/**/*'

eslint_plugin_task:
alias: eslint_plugin
depends_on:
- build_eslint
env:
CIRRUS_CLONE_DEPTH: 1
SONARSOURCE_QA: true
<<: *ESLINT_BUILD_CACHE
<<: *NPMRC_SCRIPT_DEFINITION
# needed because we need to build the plugin
matrix:
- name: 'eslint-plugin-sonarjs test with ESLint 9 and min supported node version'
<<: *NODE_MIN_SUPPORTED_CONTAINER_DEFINITION
env:
ESLINT_VERSION: 9
- name: 'eslint-plugin-sonarjs test with ESLint 8 and min supported node version'
<<: *NODE_MIN_SUPPORTED_CONTAINER_DEFINITION
env:
ESLINT_VERSION: 8
- name: 'eslint-plugin-sonarjs test with ESLint 8 and node 16'
<<: *NODE16_CONTAINER_DEFINITION
env:
ESLINT_VERSION: 8
eslint_its_script:
- node --version
- cd its/eslint${ESLINT_VERSION}-plugin-sonarjs
- npm install
- npx tsc --noEmit # check typings for tseslint.config.ts
- npm run test

promote_task:
depends_on:
- test_js_win
- test_java_win
- eslint_plugin
- plugin_qa_with_node
- plugin_qa_without_node
- plugin_qa_fast_with_node
- plugin_qa_fast_without_node
- plugin_qa_win
- plugin_qa_win_fast_with_node
- css_ruling
- ruling
- js_ts_ruling
- analyze
<<: *ONLY_SONARSOURCE_QA
<<: *SMALL_CONTAINER
env:
ARTIFACTORY_PROMOTE_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promoter access_token]
GITHUB_TOKEN: VAULT[development/github/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promotion token]
<<: *MAVEN_CACHE
script: cirrus_promote_maven
Loading