Skip to content

Commit 24cda94

Browse files
Migrate test analyze from Cirrus to GitHub actions
1 parent f826da9 commit 24cda94

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.cirrus.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ sonar_shadow_scan_and_issue_replication_task:
115115
- ./shadow-scan-and-issue-replication.sh -Dsonar.analysisCache.enabled=true -Dsonar.sca.exclusions="**/test/files/**, **/test/resources/**, its/plugin/projects/**, java-checks-test-sources/**, its/sources/**,"
116116
cleanup_before_cache_script: cleanup_maven_repository
117117

118+
# Migrated to GHA.
118119
test_analyze_task:
119120
<<: *COMMON_BUILD_DEFINITION
120121
build_script:

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,42 @@ jobs:
131131
run: |
132132
cd its/plugin
133133
mvn package --batch-mode -Pit-plugin -Dsonar.runtimeVersion=${{ matrix.sq_version }} -Dmaven.test.redirectTestOutputToFile=false -B -e -V -Dparallel=classes -DuseUnlimitedThreads=true
134+
135+
test-analyze:
136+
name: Test Analyze
137+
# needs:
138+
# - build
139+
runs-on: github-ubuntu-latest-m
140+
permissions:
141+
id-token: write
142+
contents: write
143+
env:
144+
BUILD_NUMBER: 41697
145+
steps:
146+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
147+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
148+
with:
149+
version: 2025.7.12
150+
- uses: SonarSource/vault-action-wrapper@v3
151+
id: secrets
152+
with:
153+
secrets: |
154+
development/kv/data/next url | SONAR_HOST_URL;
155+
development/kv/data/next token | SONAR_TOKEN;
156+
- name: Test Analyze
157+
env:
158+
SONAR_HOST_URL: ${{ fromJSON(steps.secrets.outputs.vault).SONAR_HOST_URL }}
159+
SONAR_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).SONAR_TOKEN }}
160+
run: |
161+
# ignore duplications in the SE engine plugin, as it will be moved away from sonar-java at some point
162+
PULL_REQUEST_SHA=$GIT_SHA1 mvn clean verify sonar:sonar --batch-mode -P-deploy-sonarsource,-release,-sign -Dmaven.deploy.skip=true -Dsonar.analysisCache.enabled=true -Dsonar.sca.exclusions="**/test/files/**, **/test/resources/**, its/plugin/projects/**, java-checks-test-sources/**, its/sources/**,"
163+
cd docs/java-custom-rules-example
164+
mvn clean package -f pom_SQ_10_6_LATEST.xml --batch-mode
165+
- name: Check License Compliance
166+
run: |
167+
# See https://xtranet.sonarsource.com/display/DEV/Open+Source+Licenses
168+
mvn org.codehaus.mojo:license-maven-plugin:aggregate-add-third-party \
169+
--batch-mode \
170+
"-Dlicense.missingFile=${PWD}/missing-dep-licenses.properties" \
171+
-DuseMissingFile \
172+
"-Dlicense.overrideUrl=file://${PWD}/override-dep-licenses.properties"

0 commit comments

Comments
 (0)