Skip to content

Commit 504604f

Browse files
SONARJAVA-5855 Migrate sanity_task from Cirrus to GitHub action (#5347)
1 parent 70e59d6 commit 504604f

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.cirrus.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ plugin_qa_task:
175175
- mvn package --batch-mode -Pit-plugin -Dsonar.runtimeVersion=${SQ_VERSION} -Dmaven.test.redirectTestOutputToFile=false -B -e -V -Dparallel=classes -DuseUnlimitedThreads=true
176176
cleanup_before_cache_script: cleanup_maven_repository
177177

178+
# Migrated to GHA.
178179
sanity_task:
179180
depends_on:
180181
- build

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,47 @@ jobs:
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
134134
135+
sanity:
136+
name: Sanity Test
137+
needs:
138+
- build
139+
if: ${{ needs.build.outputs.deployed }}
140+
runs-on: github-ubuntu-latest-m
141+
permissions:
142+
id-token: write
143+
contents: write
144+
env:
145+
BUILD_NUMBER: ${{ needs.build.outputs.build-number }}
146+
steps:
147+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
148+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
149+
with:
150+
version: 2025.7.12
151+
- uses: SonarSource/vault-action-wrapper@v3
152+
id: secrets
153+
with:
154+
secrets: |
155+
development/kv/data/next url | SONAR_HOST_URL;
156+
development/kv/data/next token | SONAR_TOKEN;
157+
- name: Compile Test Sources
158+
env:
159+
SONAR_HOST_URL: ${{ fromJSON(steps.secrets.outputs.vault).SONAR_HOST_URL }}
160+
SONAR_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).SONAR_TOKEN }}
161+
working-directory: java-checks-test-sources
162+
run: |
163+
mvn clean compile --batch-mode
164+
- uses: SonarSource/ci-github-actions/config-maven@v1
165+
with:
166+
deploy: false
167+
artifactory-reader-role: private-reader
168+
artifactory-deployer-role: qa-deployer
169+
- name: Sanity Test
170+
env:
171+
SONAR_HOST_URL: ${{ fromJSON(steps.secrets.outputs.vault).SONAR_HOST_URL }}
172+
SONAR_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).SONAR_TOKEN }}
173+
run: |
174+
mvn verify --batch-mode -f sonar-java-plugin/pom.xml -Psanity -Dtest=SanityTest
175+
135176
test-analyze:
136177
name: Test Analyze
137178
needs:

0 commit comments

Comments
 (0)