Skip to content

Commit 04e4ac4

Browse files
BUILD-9760 test working-directory input of build-gradle and config-gradle
1 parent 1934469 commit 04e4ac4

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
contents: write
3333
attestations: write
3434
needs: get-build-number
35+
env:
36+
BUILD_NUMBER: ${{ needs.get-build-number.outputs.BUILD_NUMBER }}
3537
steps:
3638
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3739
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
@@ -40,8 +42,6 @@ jobs:
4042
- name: Build, Analyze and deploy
4143
id: build
4244
uses: SonarSource/ci-github-actions/build-gradle@master # dogfood
43-
env:
44-
BUILD_NUMBER: ${{ needs.get-build-number.outputs.BUILD_NUMBER }}
4545
with:
4646
deploy-pull-request: true
4747
artifactory-reader-role: private-reader
@@ -68,6 +68,35 @@ jobs:
6868
./gradlew test --info --no-scan | tee qa-test.log
6969
grep "Downloading https://repox.jfrog.io/artifactory/sonarsource-qa/org/sonarsource/sonarqube/sonar-plugin-api/" qa-test.log
7070
71+
test-working-directory:
72+
runs-on: sonar-s-public
73+
name: Test with working-directory
74+
permissions:
75+
id-token: write
76+
contents: write
77+
needs:
78+
- get-build-number
79+
- build
80+
env:
81+
BUILD_NUMBER: ${{ needs.get-build-number.outputs.BUILD_NUMBER }}
82+
steps:
83+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
84+
with:
85+
path: subdir
86+
- name: Workaround for setup-gradle which has no working-directory input
87+
run: |
88+
cp subdir/mise.toml mise.toml
89+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
90+
with:
91+
version: 2025.7.12
92+
- uses: SonarSource/ci-github-actions/config-gradle@master # dogfood
93+
with:
94+
use-develocity: false
95+
artifactory-reader-role: private-reader
96+
working-directory: subdir
97+
- working-directory: subdir
98+
run: ./gradlew test
99+
71100
build-windows:
72101
runs-on: warp-custom-windows-2022-s
73102
name: Build Windows
@@ -76,15 +105,15 @@ jobs:
76105
contents: write
77106
attestations: write
78107
needs: get-build-number
108+
env:
109+
BUILD_NUMBER: ${{ needs.get-build-number.outputs.BUILD_NUMBER }}
79110
steps:
80111
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
81112
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
82113
with:
83114
version: 2025.7.12
84115
- uses: SonarSource/ci-github-actions/build-gradle@master # dogfood
85116
id: build
86-
env:
87-
BUILD_NUMBER: ${{ needs.get-build-number.outputs.BUILD_NUMBER }}
88117
with:
89118
deploy: false
90119
artifactory-reader-role: private-reader
@@ -106,14 +135,15 @@ jobs:
106135
- get-build-number
107136
- build
108137
- build-windows
138+
- test-working-directory
109139
runs-on: github-ubuntu-latest-s
110140
name: Promote
111141
permissions:
112142
id-token: write
113143
contents: write
144+
env:
145+
BUILD_NUMBER: ${{ needs.get-build-number.outputs.BUILD_NUMBER }}
114146
steps:
115147
- uses: SonarSource/ci-github-actions/promote@master # dogfood
116-
env:
117-
BUILD_NUMBER: ${{ needs.get-build-number.outputs.BUILD_NUMBER }}
118148
with:
119149
promote-pull-request: true

0 commit comments

Comments
 (0)