Skip to content

Commit 77226e4

Browse files
SONARXML-259 Migrate ruling tasks to GitHub actions (#359)
Co-authored-by: Copilot <[email protected]>
1 parent 7b40dc1 commit 77226e4

File tree

1 file changed

+29
-38
lines changed

1 file changed

+29
-38
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -26,59 +26,50 @@ jobs:
2626
- uses: SonarSource/ci-github-actions/get-build-number@v1
2727
id: get-build-number
2828

29-
build-linux:
30-
name: Build Linux
31-
runs-on: github-ubuntu-latest-s # Custom GitHub-hosted runner for public repos
32-
needs: get-build-number
33-
permissions:
34-
id-token: write # Required for Vault OIDC authentication
35-
contents: write # Required for repository access and tagging
36-
env:
37-
BUILD_NUMBER: ${{ needs.get-build-number.outputs.build-number }}
38-
steps:
39-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
40-
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2.4.4
41-
with:
42-
version: 2025.7.12
43-
- uses: SonarSource/ci-github-actions/build-maven@v1
44-
with:
45-
deploy-pull-request: true
46-
artifactory-reader-role: private-reader
47-
artifactory-deployer-role: qa-deployer
48-
49-
build-windows:
50-
name: Build Windows
51-
runs-on: github-windows-latest-s
29+
build:
30+
strategy:
31+
matrix:
32+
item:
33+
- { runner: "github-ubuntu-latest-s", deploy: true}
34+
- { runner: "github-windows-latest-s", deploy: false}
35+
name: Build on ${{ matrix.item.runner }}
36+
runs-on: ${{ matrix.item.runner }}
5237
needs: get-build-number
5338
permissions:
5439
id-token: write # Required for Vault OIDC authentication
5540
contents: write # Required for repository access and tagging
5641
env:
5742
BUILD_NUMBER: ${{ needs.get-build-number.outputs.build-number }}
5843
steps:
59-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
60-
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2.4.4
44+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
45+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
6146
with:
6247
version: 2025.7.12
6348
- uses: SonarSource/ci-github-actions/build-maven@v1
6449
with:
65-
deploy-pull-request: false
50+
deploy-pull-request: ${{ matrix.item.deploy }}
6651
artifactory-reader-role: private-reader
6752
artifactory-deployer-role: qa-deployer
6853

69-
plugin-qa:
70-
runs-on: github-ubuntu-latest-s # Custom GitHub-hosted runner for public repos
71-
name: Plugin QA (${{ matrix.sq_version }})
54+
qa:
55+
strategy:
56+
matrix:
57+
item:
58+
- { suite: "plugin", sq_version: "DEV", runner: "github-ubuntu-latest-s"}
59+
- { suite: "plugin", sq_version: "LATEST_RELEASE", runner: "github-ubuntu-latest-s"}
60+
- { suite: "ruling", sq_version: "LATEST_RELEASE", runner: "github-ubuntu-latest-s"}
61+
- { suite: "ruling", sq_version: "LATEST_RELEASE", runner: "github-windows-latest-s"}
62+
runs-on: ${{ matrix.item.runner }}
63+
name: QA Tests
7264
needs:
7365
- get-build-number
74-
- build-linux
66+
- build # We only need the build that deploys the artifacts to run ruling.
7567
permissions:
7668
id-token: write # Required for Vault OIDC authentication
7769
contents: write # Required for repository access
78-
strategy:
79-
matrix:
80-
sq_version: [LATEST_RELEASE, DEV]
8170
env:
71+
SUITE: ${{ matrix.item.suite }}
72+
SQ_VERSION: ${{ matrix.item.sq_version }}
8273
BUILD_NUMBER: ${{ needs.get-build-number.outputs.build-number }}
8374
steps:
8475
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -103,15 +94,15 @@ jobs:
10394
env:
10495
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
10596
ARTIFACTORY_ACCESS_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN }}
97+
shell: bash # Set explicitly so Bash is used on Windows runners too.
10698
run: |
107-
cd its/plugin
108-
mvn verify -Pit-plugin -Dsonar.runtimeVersion=${{ matrix.sq_version }} -Dmaven.test.redirectTestOutputToFile=false -B -e -V
99+
cd "its/${SUITE}"
100+
mvn verify "-Pit-${SUITE}" "-Dsonar.runtimeVersion=${SQ_VERSION}" -Dmaven.test.redirectTestOutputToFile=false -B -e -V
109101
110102
promote:
111103
needs:
112-
- build-linux
113-
- build-windows
114-
- plugin-qa
104+
- build
105+
- qa
115106
runs-on: github-ubuntu-latest-s # Custom GitHub-hosted runner for public repos
116107
name: Promote
117108
permissions:

0 commit comments

Comments
 (0)