Skip to content

Commit 7a30084

Browse files
SCANJLIB-286 Migrate to GitHub Actions
1 parent 8906f80 commit 7a30084

File tree

5 files changed

+118
-117
lines changed

5 files changed

+118
-117
lines changed

.cirrus.star

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

.cirrus.yml

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

.github/workflows/build.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- 'branch-*'
7+
pull_request:
8+
merge_group:
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
id-token: write
17+
contents: write
18+
19+
jobs:
20+
build:
21+
name: Build
22+
runs-on: github-ubuntu-latest-s
23+
timeout-minutes: 30
24+
steps:
25+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
with:
27+
fetch-depth: 0
28+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
29+
with:
30+
version: 2025.7.12
31+
- uses: SonarSource/ci-github-actions/build-maven@v1
32+
with:
33+
artifactory-reader-role: private-reader
34+
artifactory-deployer-role: qa-deployer
35+
deploy-pull-request: true
36+
- name: Upload test results on failure
37+
if: failure()
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: test-results
41+
path: '**/target/surefire-reports/**/*.xml'
42+
if-no-files-found: ignore
43+
44+
qa:
45+
name: QA
46+
needs: build
47+
runs-on: github-ubuntu-latest-s
48+
strategy:
49+
fail-fast: false
50+
matrix:
51+
sonar-version:
52+
- LATEST_RELEASE
53+
- LATEST_RELEASE[2025.1]
54+
- LATEST_RELEASE[9.9]
55+
java-version:
56+
- LATEST_RELEASE
57+
steps:
58+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
59+
60+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
61+
with:
62+
version: 2025.7.12
63+
64+
- name: Select Java 17
65+
run: mise use java@17
66+
67+
- name: Getting Vault Secrets
68+
uses: SonarSource/vault-action-wrapper@v3
69+
with:
70+
secrets: |
71+
development/artifactory/token/SonarSource-sonar-scanner-java-library-private-reader access_token | ARTIFACTORY_ACCESS_TOKEN;
72+
development/github/token/licenses-ro token | GITHUB_TOKEN
73+
74+
- name: Configure Maven
75+
uses: SonarSource/ci-github-actions/config-maven@v1
76+
with:
77+
artifactory-reader-role: private-reader
78+
79+
- name: Run ITs
80+
env:
81+
BUILD_NUMBER: ${{ github.run_number }}
82+
run: |
83+
cd its
84+
mvn -B -e verify -Prun-its -Dsonar.runtimeVersion=${{ matrix.sonar-version }} -DjavaVersion=${{ matrix.java-version }}
85+
86+
- name: Upload server logs
87+
if: failure()
88+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
89+
with:
90+
name: server-logs-${{ github.job }}-${{ strategy.job-index }}
91+
path: "**/target/**/logs/**.log"
92+
if-no-files-found: ignore
93+
94+
- name: Upload test results
95+
if: failure()
96+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
97+
with:
98+
name: test-results-${{ github.job }}-${{ strategy.job-index }}
99+
path: "**/target/surefire-reports/**.xml"
100+
if-no-files-found: ignore
101+
102+
promote:
103+
needs:
104+
- build
105+
runs-on: github-ubuntu-latest-s
106+
name: Promote
107+
steps:
108+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
109+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
110+
with:
111+
cache_save: false
112+
version: 2025.7.12
113+
- uses: SonarSource/ci-github-actions/get-build-number@v1
114+
- uses: SonarSource/ci-github-actions/promote@v1
115+
with:
116+
promote-pull-request: true

.github/workflows/releasability.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ jobs:
1313
id-token: write
1414
statuses: write
1515
contents: read
16-
if: >-
17-
(contains(fromJSON('["main", "master"]'), github.event.check_suite.head_branch) || startsWith(github.event.check_suite.head_branch, 'dogfood-') || startsWith(github.event.check_suite.head_branch, 'branch-'))
18-
&& github.event.check_suite.conclusion == 'success'
19-
&& github.event.check_suite.app.slug == 'cirrus-ci'
16+
if: github.event.workflow_run.conclusion == 'success'
2017
steps:
2118
- uses: SonarSource/gh-action_releasability/releasability-status@v3
2219
with:

lib/src/test/java/org/sonarsource/scanner/lib/internal/facade/forked/JavaRunnerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void execute_shouldConsummeProcessStdOut() {
4848
assertThat(runner.execute(List.of("--version"), "test", stdOut::add)).isTrue();
4949

5050
assertThat(stdOut).isNotEmpty();
51-
assertThat(logTester.logs(Level.ERROR)).isEmpty();
51+
assertThat(logTester.logs(Level.ERROR)).allMatch(s -> s.startsWith("[stderr] "));
5252
}
5353

5454
@Test

0 commit comments

Comments
 (0)