Skip to content

Commit 3f4ee44

Browse files
committed
impl: isolate sonar build to sdk-platform-java
1 parent 1a48159 commit 3f4ee44

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

.github/workflows/sdk-platform-java-sonar.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,18 @@ jobs:
4747
path: ~/.m2
4848
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
4949
restore-keys: ${{ runner.os }}-m2
50-
- name: Install modules to local maven
51-
run: |
52-
mvn install -T 1C -DskipTests -ntp -B
53-
cd java-showcase
54-
mvn install -T 1C -DskipTests -ntp -B
50+
- name: Install sdk-platform-modules
51+
shell: bash
52+
run: .kokoro/build.sh
53+
env:
54+
BUILD_SUBDIR: sdk-platform-java
55+
JOB_TYPE: install
56+
- name: Install java-showcase
57+
shell: bash
58+
run: mvn install -T 1C -DskipTests -ntp -B
59+
working-directory: sdk-platform-java/java-showcase
5560
- name: Parse showcase version
56-
working-directory: java-showcase/gapic-showcase
61+
working-directory: sdk-platform-java/java-showcase/gapic-showcase
5762
run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV"
5863
- name: Install showcase server
5964
run: |
@@ -69,6 +74,7 @@ jobs:
6974
# step for a few tests (env var tests) may be overkill and should be better covered
7075
# when we can upgrade to JUnit 5 (https://github.com/googleapis/sdk-platform-java/issues/1611#issuecomment-1970079325)
7176
- name: Build and analyze for full test coverage
77+
working-directory: sdk-platform-java
7278
env:
7379
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
7480
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FOR_GENERATOR }}
@@ -80,8 +86,8 @@ jobs:
8086
-Dsonar.projectKey=googleapis_google-cloud-java_generator \
8187
-Dsonar.organization=googleapis \
8288
-Dsonar.host.url=https://sonarcloud.io
83-
-Dsonar.projectBaseDir=sdk-platform-java
8489
- name: Build and analyze Showcase Integration Tests Coverage
90+
working-directory: sdk-platform-java
8591
env:
8692
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
8793
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FOR_SHOWCASE }}
@@ -95,4 +101,3 @@ jobs:
95101
-Dsonar.organization=googleapis \
96102
-Dsonar.host.url=https://sonarcloud.io \
97103
-Dsonar.projectName=googleapis_google-cloud-java_showcase
98-
-Dsonar.projectBaseDir=sdk-platform-java

0 commit comments

Comments
 (0)