Skip to content

Commit f826da9

Browse files
SONARJAVA-5824 Migrate QA from Cirrus to Github actions (#5338)
Co-authored-by: Gabriel Fleischer <[email protected]>
1 parent 77ff259 commit f826da9

File tree

3 files changed

+99
-1
lines changed

3 files changed

+99
-1
lines changed

.cirrus.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ qa_os_win_task:
142142
- ps: .cirrus/install-latest-java-on-windows.ps1 ; if ($?) { & mvn.cmd --batch-mode clean verify }
143143
cleanup_before_cache_script: cleanup_maven_repository
144144

145+
# Migrated to GHA
145146
plugin_qa_task:
146147
depends_on:
147148
- build
@@ -195,6 +196,7 @@ sanity_task:
195196
- mvn verify --batch-mode -f sonar-java-plugin/pom.xml -Psanity -Dtest=SanityTest
196197
cleanup_before_cache_script: cleanup_maven_repository
197198

199+
# Migrated to GHA
198200
ruling_task:
199201
depends_on:
200202
- build
@@ -226,6 +228,7 @@ ruling_task:
226228
actual_artifacts:
227229
path: "${CIRRUS_WORKING_DIR}/its/ruling/target/actual/**/*"
228230

231+
# Migrated to GHA
229232
ruling_win_task:
230233
depends_on:
231234
- build

.github/workflows/build.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ jobs:
2121
permissions:
2222
id-token: write # Required for Vault OIDC authentication
2323
contents: write # Required for repository access and tagging
24+
outputs:
25+
build-number: ${{ steps.build-maven.outputs.BUILD_NUMBER }}
26+
deployed: ${{ steps.build-maven.outputs.deployed }}
2427
steps:
2528
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2629
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
2730
with:
2831
version: 2025.7.12
2932
- uses: SonarSource/ci-github-actions/build-maven@v1
33+
id: build-maven
3034
with:
3135
deploy-pull-request: true
3236
# Override artifactory roles for public repo using private access
@@ -36,3 +40,94 @@ jobs:
3640
-Dmaven.test.skip=true
3741
-Dsonar.skip=true
3842
-pl !java-checks-test-sources/default,!java-checks-test-sources/aws,!java-checks-test-sources/spring-web-4.0
43+
44+
ruling-qa:
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
runner:
49+
- github-ubuntu-latest-m
50+
- github-windows-latest-m
51+
profile:
52+
- without-sonarqube-project
53+
- only-sonarqube-project
54+
name: Ruling QA
55+
needs:
56+
- build
57+
if: ${{ needs.build.outputs.deployed }}
58+
runs-on: ${{ matrix.runner }}
59+
permissions:
60+
id-token: write
61+
contents: write
62+
env:
63+
BUILD_NUMBER: ${{ needs.build.outputs.build-number }}
64+
steps:
65+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
66+
with:
67+
submodules: recursive
68+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
69+
with:
70+
version: 2025.7.12
71+
- name: Select Java 17
72+
run: mise use java@17
73+
- name: Configure Maven
74+
uses: SonarSource/ci-github-actions/config-maven@v1
75+
with:
76+
artifactory-reader-role: private-reader
77+
- name: Getting Vault Secrets
78+
id: secrets
79+
uses: SonarSource/vault-action-wrapper@320bd31b03e5dacaac6be51bbbb15adf7caccc32 # v3.1.0
80+
with:
81+
secrets: |
82+
development/github/token/licenses-ro token | GITHUB_TOKEN;
83+
- name: Run ruling tests
84+
shell: bash # Set explicitly so Bash is used on Windows runners too.
85+
env:
86+
MAVEN_OPTS: "-Xmx3g"
87+
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
88+
run: |
89+
cd its/ruling
90+
mvn package --batch-mode "-Pit-ruling,${{ matrix.profile }}" -Dsonar.runtimeVersion=LATEST_RELEASE -Dmaven.test.redirectTestOutputToFile=false -B -e -V -Dparallel=methods -DuseUnlimitedThreads=true
91+
92+
plugin-qa:
93+
strategy:
94+
fail-fast: false
95+
matrix:
96+
sq_version:
97+
- LATEST_RELEASE
98+
- DEV
99+
name: Plugin QA
100+
needs:
101+
- build
102+
if: ${{ needs.build.outputs.deployed }}
103+
runs-on: github-ubuntu-latest-m
104+
permissions:
105+
id-token: write
106+
contents: write
107+
env:
108+
BUILD_NUMBER: ${{ needs.build.outputs.build-number }}
109+
steps:
110+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
111+
with:
112+
submodules: recursive
113+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
114+
with:
115+
version: 2025.7.12
116+
- name: Select Java 17
117+
run: mise use java@17
118+
- name: Configure Maven
119+
uses: SonarSource/ci-github-actions/config-maven@v1
120+
with:
121+
artifactory-reader-role: private-reader
122+
- name: Getting Vault Secrets
123+
id: secrets
124+
uses: SonarSource/vault-action-wrapper@320bd31b03e5dacaac6be51bbbb15adf7caccc32 # v3.1.0
125+
with:
126+
secrets: |
127+
development/github/token/licenses-ro token | GITHUB_TOKEN;
128+
- name: Plugin QA
129+
env:
130+
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
131+
run: |
132+
cd its/plugin
133+
mvn package --batch-mode -Pit-plugin -Dsonar.runtimeVersion=${{ matrix.sq_version }} -Dmaven.test.redirectTestOutputToFile=false -B -e -V -Dparallel=classes -DuseUnlimitedThreads=true

mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[tools]
2-
java = "24"
2+
java = ["24", "17"]
33
maven = "3.9"

0 commit comments

Comments
 (0)