1616 CRON_NIGHTLY_JOB_NAME : " nightly"
1717
1818only_if : $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_TAG == "" && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == 'master' || $CIRRUS_BRANCH =~ "branch-.*")
19+
1920linux_container_definition : &LINUX_CONTAINER_DEFINITION
2021 eks_container :
2122 dockerfile : .cirrus/poetry.Dockerfile
@@ -31,57 +32,12 @@ linux_container_definition: &LINUX_CONTAINER_DEFINITION
3132 cpu : 3
3233 memory : 8G
3334
34- win_vm_definition : &WINDOWS_VM_DEFINITION
35- env :
36- JF_ALIAS : " jf"
37- ec2_instance :
38- experimental : true # see https://github.com/cirruslabs/cirrus-ci-docs/issues/1051
39- image : base-windows-jdk17-v*
40- platform : windows
41- region : eu-central-1
42- type : c6id.4xlarge
43- preemptible : false
44- use_ssd : true
45-
46- win_ssd_and_clone :
47- &WIN_SSD_AND_CLONE # copy&paste from https://github.com/SonarSource/sonar-cpp/blob/a8c6f1e45a12393508682a013ac7ee35eb92bece/.cirrus.yml#L45
48- prepare_disk_script :
49- - ps : |
50- Get-Disk -Number 2 | Initialize-Disk -PassThru | New-Partition -UseMaximumSize -DriveLetter Z
51- Format-Volume -DriveLetter Z -FileSystem NTFS -Confirm:$false
52- - echo "CIRRUS_WORKING_DIR=Z:/cirrus-ci-build" >> $CIRRUS_ENV
53- # we don't clone submodules because they are not needed for the tests
54- clone_script : |
55- git config --system core.longpaths true
56- if [ -z "$CIRRUS_PR" ]; then
57- git clone --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
58- git reset --hard $CIRRUS_CHANGE_IN_REPO
59- else
60- git clone https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
61- git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR
62- git reset --hard $CIRRUS_CHANGE_IN_REPO
63- fi
64-
6535.jfrog_config_template : &JFROG_CONFIG_TEMPLATE
6636 jfrog_config_script :
6737 - $JF_ALIAS config add repox --artifactory-url "$ARTIFACTORY_URL" --access-token "$ARTIFACTORY_PRIVATE_ACCESS_TOKEN"
6838 - $JF_ALIAS poetry-config --server-id-resolve repox --repo-resolve sonarsource-pypi
6939 - $JF_ALIAS poetry install --build-name="$CIRRUS_REPO_NAME" --build-number="$CI_BUILD_NUMBER"
7040
71- poetry_win_install : &POETRY_WIN_INSTALL
72- << : *WINDOWS_VM_DEFINITION
73- << : *WIN_SSD_AND_CLONE
74- env :
75- PYTHON_VERSION : 3.12.1
76- POETRY_VERSION : 2.0.1
77- jfrog_win_install_script :
78- - powershell "Start-Process -Wait -Verb RunAs powershell '-NoProfile iwr https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/[RELEASE]/jfrog-cli-windows-amd64/jf.exe -OutFile $env:SYSTEMROOT\system32\jf.exe'"
79- - jf intro
80- poetry_win_install_script :
81- - source cirrus-env QA
82- - pip install poetry=="$POETRY_VERSION"
83- << : *JFROG_CONFIG_TEMPLATE
84-
8541poetry_cache_template : &POETRY_CACHE
8642 poetry_cache :
8743 folder : ~/.cache/poetry/
@@ -93,11 +49,6 @@ poetry_cache_template: &POETRY_CACHE
9349 poetry_install_script :
9450 - poetry install
9551
96- .poetry_set_version_template : &POETRY_SET_VERSION
97- poetry_set_version_script :
98- - source set_poetry_build_version "$CI_BUILD_NUMBER"
99- - echo "PROJECT_VERSION=$PROJECT_VERSION" >> $CIRRUS_ENV
100-
10152.poetry_macos_template : &POETRY_MACOS_TEMPLATE
10253 << : *POETRY_CACHE
10354 jfrog_install_script :
@@ -120,104 +71,6 @@ macos_worker_template: &MACOS_WORKER_DEFINITION
12071 labels :
12172 envname : prod
12273
123- formatting_task :
124- alias : formatting
125- name : " Formatting"
126- << : *LINUX_CONTAINER_DEFINITION
127- << : *POETRY_INSTALL
128- formatting_script :
129- - poetry run black src/ tests/ --check
130- - poetry run licenseheaders -t license_header.tmpl -o "SonarSource SA" -y 2011-2024 -n "Sonar Scanner Python" -E .py -d src/
131- - poetry run licenseheaders -t license_header.tmpl -o "SonarSource SA" -y 2011-2024 -n "Sonar Scanner Python" -E .py -d tests/
132- - git diff --name-only --exit-code ./src ./tests
133-
134- documentation_task :
135- alias : documentation
136- name : " CLI Documentation"
137- << : *LINUX_CONTAINER_DEFINITION
138- << : *POETRY_INSTALL
139- cli_docs_script :
140- - poetry run python tools/generate_cli_documentation.py
141- - git diff --exit-code CLI_ARGS.md
142-
143- analysis_base_linux_template : &ANALYSIS_BASE_LINUX_TEMPLATE
144- << : *LINUX_CONTAINER_DEFINITION
145- << : *POETRY_INSTALL
146- # For analysis we don't need to set the build versions, but we still need to access jfrog to recover the dependencies
147- analysis_script :
148- - poetry run pytest --cov-report=xml:coverage.xml --cov-config=pyproject.toml --cov=src --cov-branch tests
149- - poetry run mypy src/ > mypy-report.txt || true # mypy exits with 1 if there are errors
150- - uv venv
151- - source .venv/bin/activate
152- - uv pip install pysonar
153- - . .cirrus/analysis.sh
154- always :
155- pytest_artifacts :
156- path : " coverage.xml"
157- format : junit
158- type : text/xml
159-
160- analysis_next_task :
161- << : *ANALYSIS_BASE_LINUX_TEMPLATE
162- alias : sonar_analysis_next
163- name : " NEXT Analysis"
164- env :
165- SONAR_TOKEN : VAULT[development/kv/data/next data.token]
166- SONAR_HOST_URL : https://next.sonarqube.com/sonarqube
167-
168- analysis_SQC_EU_shadow_task :
169- << : *ANALYSIS_BASE_LINUX_TEMPLATE
170- # only executed in CRON job AND on master branch
171- only_if : $CIRRUS_CRON == $CRON_NIGHTLY_JOB_NAME && $CIRRUS_BRANCH == "master"
172- alias : sonar_analysis_shadow_sqc_eu
173- name : " SQC-EU Shadow Analysis"
174- env :
175- SONAR_TOKEN : VAULT[development/kv/data/sonarcloud data.token]
176- SONAR_HOST_URL : https://sonarcloud.io
177-
178- analysis_SQC_US_shadow_task :
179- << : *ANALYSIS_BASE_LINUX_TEMPLATE
180- # only executed in CRON job AND on master branch
181- only_if : $CIRRUS_CRON == $CRON_NIGHTLY_JOB_NAME && $CIRRUS_BRANCH == "master"
182- alias : sonar_analysis_shadow_sqc_us
183- name : " SQC-US Shadow Analysis"
184- env :
185- SONAR_TOKEN : VAULT[development/kv/data/sonarqube-us data.token]
186- SONAR_HOST_URL : https://sonarqube.us
187-
188- qa_task :
189- alias : qa
190- matrix :
191- - name : " Test Python 3.9.18"
192- eks_container :
193- docker_arguments :
194- PYTHON_VERSION : 3.9.18
195- - name : " Test Python 3.9.6"
196- eks_container :
197- docker_arguments :
198- PYTHON_VERSION : 3.9.6
199- - name : " Test Python 3.10"
200- eks_container :
201- docker_arguments :
202- PYTHON_VERSION : 3.10.13
203- - name : " Test Python 3.11"
204- eks_container :
205- docker_arguments :
206- PYTHON_VERSION : 3.11.7
207- - name : " Test Python 3.12"
208- eks_container :
209- docker_arguments :
210- PYTHON_VERSION : 3.12.1
211- - name : " Test Python 3.13"
212- eks_container :
213- docker_arguments :
214- PYTHON_VERSION : 3.13.2
215- << : *LINUX_CONTAINER_DEFINITION
216- << : *POETRY_INSTALL
217- << : *POETRY_SET_VERSION
218- qa_script :
219- - poetry run pytest tests/
220-
22174qa_macos_task :
22275 alias : qa_macos
22376 only_if : $CIRRUS_CRON == "macos-its-cron"
@@ -238,35 +91,6 @@ qa_macos_task:
23891 test_313_script :
23992 - .cirrus/run_macos_tests.sh "3.13.2"
24093
241- qa_windows_task :
242- name : " Test Windows"
243- << : *POETRY_WIN_INSTALL
244- << : *POETRY_SET_VERSION
245- alias : qa_windows
246- qa_script :
247- - poetry run pytest tests/
248- - exit $LASTEXITCODE
249-
250- build_task :
251- << : *LINUX_CONTAINER_DEFINITION
252- << : *POETRY_INSTALL
253- << : *POETRY_SET_VERSION
254- alias : build
255- name : " Build"
256- build_script : regular_poetry_build_publish
257-
258- its_task :
259- name : " Integration Tests"
260- alias : its
261- sonarqube_cache :
262- folder : sonarqube_cache/
263- populate_script : mkdir -p sonarqube_cache && wget -q https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-$SONARQUBE_VERSION.zip -O sonarqube_cache/sonarqube.zip
264- fingerprint_script : echo "sonarqube-$SONARQUBE_VERSION"
265- << : *LINUX_CONTAINER_DEFINITION
266- << : *POETRY_INSTALL
267- its_script :
268- - .cirrus/run_its.sh
269-
27094its_macos_task :
27195 name : " [macOS] Integration Tests"
27296 alias : its_macos
@@ -280,25 +104,7 @@ its_macos_task:
280104 its_script :
281105 - .cirrus/run_its.sh
282106
283- promote_task :
284- depends_on :
285- - formatting
286- - sonar_analysis_next
287- - qa
288- - qa_windows
289- - build
290- - its
291- env :
292- ARTIFACTORY_PROMOTE_ACCESS_TOKEN : VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promoter access_token]
293- GITHUB_TOKEN : VAULT[development/github/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promotion token]
294- << : *LINUX_CONTAINER_DEFINITION
295- << : *POETRY_INSTALL
296- << : *POETRY_SET_VERSION
297- promote_script : cirrus_promote
298-
299107run_iris_task :
300- depends_on :
301- - promote
302108 << : *LINUX_CONTAINER_DEFINITION
303109 # only executed in CRON job AND on master branch
304110 only_if : $CIRRUS_CRON == $CRON_NIGHTLY_JOB_NAME && $CIRRUS_BRANCH == "master"
0 commit comments