Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.

Commit 5cf89d6

Browse files
authored
chore: reduce showcase version duplication in source (#1864)
* chore: reduce showcase version duplication in source * chore: install modules before parsing showcase version
1 parent 38cba7f commit 5cf89d6

4 files changed

Lines changed: 25 additions & 15 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
- main
55
pull_request:
66
name: ci
7-
env:
8-
SHOWCASE_VERSION: 0.28.2
97
jobs:
108
build:
119
runs-on: ubuntu-22.04
@@ -190,12 +188,14 @@ jobs:
190188
-P enable-golden-tests \
191189
--batch-mode \
192190
--no-transfer-progress
193-
191+
- name: Parse showcase version
192+
working-directory: showcase/gapic-showcase
193+
run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV"
194194
- name: Install showcase server
195195
run: |
196196
sudo mkdir -p /usr/src/showcase
197197
sudo chown -R ${USER} /usr/src/
198-
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz
198+
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${{env.SHOWCASE_VERSION}}/gapic-showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz
199199
cd /usr/src/showcase/
200200
tar -xf showcase-*
201201
./gapic-showcase run &
@@ -222,11 +222,14 @@ jobs:
222222
- run: native-image --version
223223
- name: Install sdk-platform-java
224224
run: mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
225+
- name: Parse showcase version
226+
working-directory: showcase/gapic-showcase
227+
run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV"
225228
- name: Install showcase server
226229
run: |
227230
sudo mkdir -p /usr/src/showcase
228231
sudo chown -R ${USER} /usr/src/
229-
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz
232+
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${{env.SHOWCASE_VERSION}}/gapic-showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz
230233
cd /usr/src/showcase/
231234
tar -xf showcase-*
232235
./gapic-showcase run &

.github/workflows/sonar.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
name: SonarCloud Build
2-
env:
3-
SHOWCASE_VERSION: 0.28.2
42
on:
53
push:
64
branches:
@@ -32,11 +30,19 @@ jobs:
3230
path: ~/.m2
3331
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
3432
restore-keys: ${{ runner.os }}-m2
33+
- name: Install modules to local maven
34+
run: |
35+
mvn install -T 1C -DskipTests -ntp -B
36+
cd showcase
37+
mvn install -T 1C -DskipTests -ntp -B
38+
- name: Parse showcase version
39+
working-directory: showcase/gapic-showcase
40+
run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV"
3541
- name: Install showcase server
3642
run: |
3743
sudo mkdir -p /usr/src/showcase
3844
sudo chown -R ${USER} /usr/src/
39-
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz
45+
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${{env.SHOWCASE_VERSION}}/gapic-showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz
4046
cd /usr/src/showcase/
4147
tar -xf showcase-*
4248
./gapic-showcase run &

.kokoro/presubmit/downstream-build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
set -eo pipefail
1717

18-
SHOWCASE_VERSION=0.28.2
19-
2018
## Get the directory of the build script
2119
scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
2220
## cd to the parent directory, i.e. the root of the git repo
@@ -64,16 +62,19 @@ popd
6462

6563
### Round 3
6664
# Run showcase tests in GraalVM
65+
pushd showcase/gapic-showcase
66+
SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)
67+
popd
6768

6869
# Start showcase server
6970
mkdir -p /usr/src/showcase
7071
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v"${SHOWCASE_VERSION}"/gapic-showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz --output /usr/src/showcase/showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz
7172
pushd /usr/src/showcase/
7273
tar -xf showcase-*
7374
./gapic-showcase run &
75+
popd
7476

7577
# Run showcase tests with `native` profile
76-
popd
7778
pushd showcase
7879
mvn test -Pnative,-showcase -Denforcer.skip=true -ntp -B
7980
popd

showcase/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ versions is not guaranteed. If changing the version of the server, it may also b
1616
update to a compatible client version in `./WORKSPACE`.
1717

1818
```shell
19-
$ GAPIC_SHOWCASE_VERSION=0.28.2
20-
$ go install github.com/googleapis/gapic-showcase/cmd/gapic-showcase@v"$GAPIC_SHOWCASE_VERSION"
21-
$ PATH=$PATH:`go env GOPATH`/bin
22-
$ gapic-showcase --help
19+
# Install the showcase server version defined in gapic-showcase/pom.xml
20+
showcase/ $ go install github.com/googleapis/gapic-showcase/cmd/gapic-showcase@v"$(cd gapic-showcase;mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)"
21+
showcase/ $ PATH=$PATH:`go env GOPATH`/bin
22+
showcase/ $ gapic-showcase --help
2323
> Root command of gapic-showcase
2424
>
2525
> Usage:

0 commit comments

Comments
 (0)