Skip to content

Commit 7c5882b

Browse files
SamirM-BEGabrielFleischer
authored andcommitted
Backport CI
SONARSCALA-78 Fix artifact signing (#70) (cherry picked from commit 16c07f7) SONARJAVA-5812 Use config-gradle action in QA (#67) (cherry picked from commit d2ee878) SONARSCALA-70 Delete Cirrus CI config (#69) (cherry picked from commit c434fcc) SONARSCALA-74 Create GitHub action for unified dogfooding (#68) (cherry picked from commit 916a85a) SONARSCALA-73 Global improvement of the CI to fit new needs (#66) (cherry picked from commit 15aaec3) SONARSCALA-71 Bootstrap the new build CI for sonar-scala (#64) (cherry picked from commit f3f44e3) SONARSCALA-69 Delete mend_task (#63) (cherry picked from commit d92b76f) SONARSCALA-66 Wait for the sonarcloud compute engine to finish (#62) (cherry picked from commit 1455d48) SONARSCALA-68 Update GH release and releasability actions (#61) (cherry picked from commit f33505a) SONARSCALA-66 Unify Platform Dogfooding of sonar-scala (#60) (cherry picked from commit 5e4133d) BUILD-8875: Migrate to standardized GitHub runner names (#59) (cherry picked from commit 81d679f) BUILD-8073 Migrate public repositories workflows to large runners (cherry picked from commit 4a54cc2)
1 parent 7c3eb07 commit 7c5882b

17 files changed

+184
-181
lines changed

.cirrus.star

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

.cirrus.yml

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

.github/workflows/PullRequestClosed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
PullRequestMerged_job:
99
name: Pull Request Merged
10-
runs-on: ubuntu-latest
10+
runs-on: github-ubuntu-latest-s
1111
permissions:
1212
id-token: write
1313
pull-requests: read

.github/workflows/PullRequestCreated.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
PullRequestCreated_job:
99
name: Pull Request Created
10-
runs-on: ubuntu-latest
10+
runs-on: github-ubuntu-latest-s
1111
permissions:
1212
id-token: write
1313
# For external PR, ticket should be created manually

.github/workflows/RequestReview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
RequestReview_job:
99
name: Request review
10-
runs-on: ubuntu-latest
10+
runs-on: github-ubuntu-latest-s
1111
permissions:
1212
id-token: write
1313
# For external PR, ticket should be moved manually

.github/workflows/SubmitReview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
SubmitReview_job:
99
name: Submit Review
10-
runs-on: ubuntu-latest
10+
runs-on: github-ubuntu-latest-s
1111
permissions:
1212
id-token: write
1313
pull-requests: read

.github/workflows/ToggleLockBranch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
ToggleLockBranch_job:
88
name: Toggle lock branch
9-
runs-on: ubuntu-latest
9+
runs-on: github-ubuntu-latest-s
1010
permissions:
1111
id-token: write
1212
steps:

.github/workflows/build.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- branch-*
8+
- dogfood-*
9+
pull_request:
10+
workflow_dispatch:
11+
schedule:
12+
- cron: "30 1 * * *" # Run daily at 1:30 AM UTC
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
runs-on: github-ubuntu-latest-s # Public repository runner
21+
name: Build
22+
permissions:
23+
id-token: write # Required for Vault OIDC authentication
24+
contents: write # Required for repository access and tagging
25+
outputs:
26+
build-number: ${{ steps.build-step.outputs.BUILD_NUMBER }}
27+
deployed: ${{ steps.build-step.outputs.deployed }}
28+
steps:
29+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
30+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
31+
with:
32+
version: 2025.7.12
33+
- uses: SonarSource/ci-github-actions/build-gradle@v1
34+
id: build-step
35+
with:
36+
deploy-pull-request: true
37+
artifactory-reader-role: private-reader # Override for public repo using private access
38+
artifactory-deployer-role: qa-deployer # Override for public repo using private access
39+
40+
qa:
41+
needs: [build]
42+
if: ${{ needs.build.outputs.deployed }}
43+
runs-on: github-ubuntu-latest-s # Public repository runner
44+
permissions:
45+
id-token: write # Required for Vault OIDC authentication
46+
contents: read # Required for repository access
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
# Plugin tests check API compatibility, so they should run against all supported versions.
51+
# Ruling tests check only that the results of analysis have not changed,
52+
# so one sonar.runtimeVersion is enough.
53+
item:
54+
- { suite: "plugin", sq_version: "DEV", submodules: false}
55+
- { suite: "plugin", sq_version: "LATEST_RELEASE", submodules: false}
56+
- { suite: "ruling", sq_version: "LATEST_RELEASE" }
57+
name: "QA Tests [${{ matrix.item.suite }}] - SQ : ${{ matrix.item.sq_version }}"
58+
steps:
59+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
60+
with:
61+
submodules: ${{ matrix.item.suite == 'ruling' }}
62+
- name: Remove kotlin ITs as they are not relevant for ruling tests (and cause issues with wrapper validation)
63+
if: ${{ matrix.item.suite == 'ruling' }}
64+
run: rm -r ./its/sources/kotlin
65+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
66+
with:
67+
version: 2025.7.12
68+
- name: Get GitHub Token for QA Licenses
69+
id: secrets
70+
uses: SonarSource/vault-action-wrapper@v3
71+
with:
72+
secrets: |
73+
development/github/token/licenses-ro token | GITHUB_TOKEN;
74+
development/artifactory/token/{REPO_OWNER_NAME_DASH}-private-reader access_token | ARTIFACTORY_ACCESS_TOKEN;
75+
- name: Configure Gradle
76+
uses: SonarSource/ci-github-actions/build-gradle@v1
77+
with:
78+
gradle-args: "-x build -x sonar -x artifactoryPublish" # Skip everything to only configure Gradle and Artifactory access
79+
artifactory-reader-role: private-reader
80+
artifactory-deployer-role: qa-deployer
81+
- name: Run QA Tests
82+
env:
83+
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
84+
ARTIFACTORY_ACCESS_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN }}
85+
SUITE: ${{ matrix.item.suite }}
86+
SQ_VERSION: ${{ matrix.item.sq_version }}
87+
run: |
88+
./gradlew ":its:${SUITE}:test" --project-prop ${SUITE} \
89+
"-Dsonar.runtimeVersion=${SQ_VERSION}" \
90+
"-Dorchestrator.artifactory.accessToken=${ARTIFACTORY_ACCESS_TOKEN}" \
91+
"-DbuildNumber=${BUILD_NUMBER}" \
92+
--info --stacktrace --console plain --no-daemon --build-cache
93+
promote:
94+
name: Promote
95+
needs:
96+
- build
97+
- qa
98+
runs-on: github-ubuntu-latest-s # Public repository runner
99+
if: ${{ needs.build.outputs.deployed }}
100+
permissions:
101+
id-token: write # Required for Vault OIDC authentication
102+
contents: write # Required for repository access and tagging
103+
steps:
104+
- uses: SonarSource/ci-github-actions/promote@v1
105+
with:
106+
promote-pull-request: true # Enable PR artifact promotion

.github/workflows/mark-prs-stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
stale:
9-
runs-on: ubuntu-latest
9+
runs-on: github-ubuntu-latest-s
1010
permissions:
1111
issues: write
1212
pull-requests: write

.github/workflows/pr-cleanup.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Cleanup PR Resources
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
7+
jobs:
8+
cleanup:
9+
runs-on: github-ubuntu-latest-s
10+
permissions:
11+
actions: write
12+
steps:
13+
- uses: SonarSource/ci-github-actions/pr_cleanup@v1

0 commit comments

Comments
 (0)