Skip to content

Commit 1c0a887

Browse files
JACOCO-56 SONARJAVA-5813 Fix QA and add its job to GH Action (#134)
1 parent 182d7d6 commit 1c0a887

File tree

6 files changed

+56
-268
lines changed

6 files changed

+56
-268
lines changed

.cirrus.star

Lines changed: 0 additions & 4 deletions
This file was deleted.

.cirrus.yml

Lines changed: 0 additions & 121 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,78 @@ jobs:
2222
id-token: write # Required for Vault OIDC authentication
2323
contents: write # Required for repository access and tagging
2424
outputs:
25-
build-number: ${{ steps.build-gradle.outputs.BUILD_NUMBER }}
25+
build-number: ${{ steps.build-step.outputs.BUILD_NUMBER }}
26+
deployed: ${{ steps.build-step.outputs.deployed }}
2627
steps:
2728
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2829
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
2930
with:
3031
version: 2025.7.12
3132
- uses: SonarSource/ci-github-actions/build-gradle@v1
32-
id: build-gradle
33+
id: build-step
3334
with:
3435
deploy-pull-request: true
3536
artifactory-reader-role: private-reader
3637
artifactory-deployer-role: qa-deployer
3738

38-
# QA is broken due to JACOCO-56
39+
qa:
40+
needs: [build]
41+
if: ${{ needs.build.outputs.deployed }}
42+
runs-on: github-ubuntu-latest-m
43+
permissions:
44+
id-token: write
45+
contents: read
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
item:
50+
- { sq-version: LATEST_RELEASE }
51+
- { sq-version: DEV }
52+
name: "QA Tests - SQ : ${{ matrix.item.sq-version }}"
53+
env:
54+
BUILD_NUMBER: ${{ needs.build.outputs.build-number }}
55+
steps:
56+
- name: Checkout repository
57+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
58+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
59+
with:
60+
version: 2025.7.12
61+
- name: Get GitHub Token for Artifactory access
62+
id: secrets
63+
uses: SonarSource/vault-action-wrapper@320bd31b03e5dacaac6be51bbbb15adf7caccc32 # 3.1.0
64+
with:
65+
secrets: |
66+
development/artifactory/token/{REPO_OWNER_NAME_DASH}-private-reader access_token | ARTIFACTORY_ACCESS_TOKEN;
67+
- name: Configure Gradle
68+
uses: SonarSource/ci-github-actions/build-gradle@v1
69+
with:
70+
gradle-args: "-x build -x sonar -x artifactoryPublish" # Skip everything to only configure Gradle and Artifactory access
71+
artifactory-reader-role: private-reader
72+
artifactory-deployer-role: qa-deployer
73+
- name: Run QA Tests
74+
shell: bash
75+
env:
76+
ARTIFACTORY_ACCESS_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN }}
77+
SQ_VERSION: ${{ matrix.item.sq-version }}
78+
run: >-
79+
./gradlew -DbuildNumber=$BUILD_NUMBER
80+
-PintegrationTests=true
81+
-Dsonar.runtimeVersion=$SQ_VERSION
82+
-Dorchestrator.artifactory.accessToken=$ARTIFACTORY_ACCESS_TOKEN
83+
--console plain --no-daemon --info
84+
build test
3985
4086
promote:
41-
needs:
42-
- build
87+
needs: [build, qa]
88+
if: ${{ needs.build.outputs.deployed }}
4389
runs-on: github-ubuntu-latest-s
4490
name: Promote
4591
permissions:
4692
id-token: write
4793
contents: write
94+
env:
95+
BUILD_NUMBER: ${{ needs.build.outputs.build-number }}
4896
steps:
49-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
50-
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
51-
with:
52-
cache_save: false
53-
version: 2025.7.12
5497
- uses: SonarSource/ci-github-actions/promote@v1
5598
with:
5699
promote-pull-request: true

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ signing {
177177
def signingPassword = findProperty("signingPassword")
178178
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
179179
required {
180-
def branch = System.getenv()["GITHUB_REF_NAME"] ?: System.getenv()["CIRRUS_BRANCH"]
180+
def branch = System.getenv()["GITHUB_REF_NAME"]
181181
return (branch == 'master' || branch ==~ 'branch-[\\d.]+') &&
182182
gradle.taskGraph.hasTask(":artifactoryPublish")
183183
}

its/src/test/java/org/sonar/plugins/jacoco/its/JacocoTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ static void beforeAll() {
6464
}
6565
builder.addPlugin(pluginLocation);
6666
try {
67-
builder.addPlugin(URLLocation.create(new URL("https://binaries.sonarsource.com/Distribution/sonar-java-plugin/sonar-java-plugin-6.2.0.21135.jar")));
68-
builder.addPlugin(URLLocation.create(new URL("https://binaries.sonarsource.com/Distribution/sonar-kotlin-plugin/sonar-kotlin-plugin-2.12.0.1956.jar")));
67+
builder.addPlugin(URLLocation.create(new URL("https://binaries.sonarsource.com/Distribution/sonar-java-plugin/sonar-java-plugin-8.19.0.40387.jar")));
68+
builder.addPlugin(URLLocation.create(new URL("https://binaries.sonarsource.com/Distribution/sonar-kotlin-plugin/sonar-kotlin-plugin-3.3.0.7402.jar")));
6969
} catch (MalformedURLException e) {
7070
throw new IllegalStateException("Failed to download plugin", e);
7171
}

shadow-scan-and-issue-replication.sh

Lines changed: 0 additions & 130 deletions
This file was deleted.

0 commit comments

Comments
 (0)