Skip to content

Commit 39133b5

Browse files
authored
chore: migrate java-spanner-jdbc to monorepo (#12133)
Migrate java-spanner-jdbc to monorepo. b/477663564
2 parents 92f300a + cfa4128 commit 39133b5

File tree

365 files changed

+109181
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

365 files changed

+109181
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
/java-bigquerystorage/ @googleapis/bigquery-team @googleapis/cloud-sdk-java-team
1111
/java-bigquery/ @googleapis/bigquery-team @googleapis/cloud-sdk-java-team
1212
/java-spanner/ @googleapis/spanner-team @googleapis/cloud-sdk-java-team
13+
/java-spanner-jdbc/ @googleapis/spanner-team @googleapis/cloud-sdk-java-team
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# Github action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
on:
17+
push:
18+
branches:
19+
- main
20+
pull_request:
21+
name: java-spanner-jdbc ci
22+
env:
23+
BUILD_SUBDIR: java-spanner-jdbc
24+
jobs:
25+
filter:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
library: ${{ steps.filter.outputs.library }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: dorny/paths-filter@v3
32+
id: filter
33+
with:
34+
filters: |
35+
library:
36+
- 'java-spanner-jdbc/**'
37+
units:
38+
needs: filter
39+
if: ${{ needs.filter.outputs.library == 'true' }}
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
java: [11, 17, 21, 25]
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: actions/setup-java@v4
48+
with:
49+
distribution: temurin
50+
java-version: ${{matrix.java}}
51+
- run: java -version
52+
- run: .kokoro/build.sh
53+
env:
54+
JOB_TYPE: test
55+
units-java8:
56+
needs: filter
57+
if: ${{ needs.filter.outputs.library == 'true' }}
58+
# Building using Java 17 and run the tests with Java 8 runtime
59+
name: "units (8)"
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: actions/setup-java@v4
64+
with:
65+
java-version: 8
66+
distribution: temurin
67+
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
68+
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
69+
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
70+
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java -P !java17" >> $GITHUB_ENV
71+
shell: bash
72+
- uses: actions/setup-java@v4
73+
with:
74+
java-version: 17
75+
distribution: temurin
76+
- run: .kokoro/build.sh
77+
env:
78+
JOB_TYPE: test
79+
windows:
80+
needs: filter
81+
if: ${{ needs.filter.outputs.library == 'true' }}
82+
runs-on: windows-latest
83+
steps:
84+
- name: Support longpaths
85+
run: git config --system core.longpaths true
86+
- name: Support longpaths
87+
run: git config --system core.longpaths true
88+
- uses: actions/checkout@v4
89+
- uses: actions/setup-java@v4
90+
with:
91+
distribution: temurin
92+
java-version: 8
93+
- run: java -version
94+
- run: .kokoro/build.sh
95+
env:
96+
JOB_TYPE: test
97+
dependencies:
98+
needs: filter
99+
if: ${{ needs.filter.outputs.library == 'true' }}
100+
runs-on: ubuntu-latest
101+
strategy:
102+
matrix:
103+
java: [17]
104+
steps:
105+
- uses: actions/checkout@v4
106+
- uses: actions/setup-java@v4
107+
with:
108+
distribution: temurin
109+
java-version: ${{matrix.java}}
110+
- run: java -version
111+
- run: .kokoro/dependencies.sh
112+
javadoc:
113+
needs: filter
114+
if: ${{ needs.filter.outputs.library == 'true' }}
115+
runs-on: ubuntu-latest
116+
steps:
117+
- uses: actions/checkout@v4
118+
- uses: actions/setup-java@v4
119+
with:
120+
distribution: temurin
121+
java-version: 17
122+
- run: java -version
123+
- run: .kokoro/build.sh
124+
env:
125+
JOB_TYPE: javadoc
126+
lint:
127+
needs: filter
128+
if: ${{ needs.filter.outputs.library == 'true' }}
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/checkout@v4
132+
with:
133+
fetch-depth: 0
134+
- uses: actions/setup-java@v4
135+
with:
136+
distribution: temurin
137+
java-version: 17
138+
- run: java -version
139+
- run: .kokoro/build.sh
140+
env:
141+
JOB_TYPE: lint
142+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
143+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
name: java-spanner-jdbc Integration tests against emulator
7+
env:
8+
BUILD_SUBDIR: java-spanner-jdbc
9+
jobs:
10+
filter:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
library: ${{ steps.filter.outputs.library }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: dorny/paths-filter@v3
17+
id: filter
18+
with:
19+
filters: |
20+
library:
21+
- 'java-spanner-jdbc/**'
22+
tests-against-emulator:
23+
needs: filter
24+
if: ${{ needs.filter.outputs.library == 'true' }}
25+
runs-on: ubuntu-latest
26+
27+
services:
28+
emulator:
29+
image: gcr.io/cloud-spanner-emulator/emulator:latest
30+
ports:
31+
- 9010:9010
32+
- 9020:9020
33+
34+
steps:
35+
- uses: actions/checkout@v6
36+
- uses: actions/setup-java@v5
37+
with:
38+
distribution: temurin
39+
java-version: 17
40+
- run: java -version
41+
- name: Install dependencies for the integration test
42+
run: .kokoro/build.sh
43+
env:
44+
JOB_TYPE: test
45+
- run: mvn -B -Dspanner.testenv.instance="" -Penable-integration-tests -DtrimStackTrace=false -Dclirr.skip=true -Denforcer.skip=true -fae verify
46+
working-directory: java-spanner-jdbc
47+
env:
48+
SPANNER_EMULATOR_HOST: localhost:9010
49+
GOOGLE_CLOUD_PROJECT: emulator-test-project
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# Github action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
on:
17+
pull_request:
18+
name: java-spanner-jdbc quickperf
19+
env:
20+
BUILD_SUBDIR: java-spanner-jdbc
21+
jobs:
22+
filter:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
library: ${{ steps.filter.outputs.library }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: dorny/paths-filter@v3
29+
id: filter
30+
with:
31+
filters: |
32+
library:
33+
- 'java-spanner-jdbc/**'
34+
quickperf:
35+
needs: filter
36+
if: ${{ needs.filter.outputs.library == 'true' }}
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v6
40+
- uses: actions/setup-java@v5
41+
with:
42+
distribution: temurin
43+
java-version: 17
44+
- name: Run tests
45+
run: mvn test
46+
working-directory: java-spanner-jdbc/samples/quickperf
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# Github action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
on:
17+
pull_request:
18+
name: java-spanner-jdbc samples
19+
env:
20+
BUILD_SUBDIR: java-spanner-jdbc
21+
jobs:
22+
filter:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
library: ${{ steps.filter.outputs.library }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: dorny/paths-filter@v3
29+
id: filter
30+
with:
31+
filters: |
32+
library:
33+
- 'java-spanner-jdbc/**'
34+
test:
35+
needs: filter
36+
if: ${{ needs.filter.outputs.library == 'true' }}
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v6
40+
- uses: actions/setup-java@v5
41+
with:
42+
distribution: temurin
43+
java-version: 8
44+
- name: Run sample tests
45+
run: mvn --quiet --batch-mode test
46+
working-directory: java-spanner-jdbc/samples/snippets
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# Github action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
on:
17+
pull_request:
18+
name: java-spanner-jdbc spring-data-jdbc-sample
19+
env:
20+
BUILD_SUBDIR: java-spanner-jdbc
21+
jobs:
22+
filter:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
library: ${{ steps.filter.outputs.library }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: dorny/paths-filter@v3
29+
id: filter
30+
with:
31+
filters: |
32+
library:
33+
- 'java-spanner-jdbc/**'
34+
spring-data-jdbc:
35+
needs: filter
36+
if: ${{ needs.filter.outputs.library == 'true' }}
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v6
40+
- uses: actions/setup-java@v5
41+
with:
42+
distribution: temurin
43+
java-version: 17
44+
- name: Run tests on GoogleSQL
45+
run: mvn test
46+
working-directory: java-spanner-jdbc/samples/spring-data-jdbc/googlesql
47+
- name: Run tests on PostgreSQL
48+
run: mvn test
49+
working-directory: java-spanner-jdbc/samples/spring-data-jdbc/postgresql
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# Github action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
on:
17+
pull_request:
18+
name: java-spanner-jdbc spring-data-mybatis-sample
19+
env:
20+
BUILD_SUBDIR: java-spanner-jdbc
21+
jobs:
22+
filter:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
library: ${{ steps.filter.outputs.library }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: dorny/paths-filter@v3
29+
id: filter
30+
with:
31+
filters: |
32+
library:
33+
- 'java-spanner-jdbc/**'
34+
spring-data-mybatis:
35+
needs: filter
36+
if: ${{ needs.filter.outputs.library == 'true' }}
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v6
40+
- uses: actions/setup-java@v5
41+
with:
42+
distribution: temurin
43+
java-version: 17
44+
- name: Run GoogleSQL sample tests
45+
run: mvn test
46+
working-directory: java-spanner-jdbc/samples/spring-data-mybatis/googlesql
47+
- name: Run PostgreSQL sample tests
48+
run: mvn test
49+
working-directory: java-spanner-jdbc/samples/spring-data-mybatis/postgresql

0 commit comments

Comments
 (0)