Skip to content

Commit 57d07e1

Browse files
authored
chore: set up CI on v1 branch (#693)
* chore: add basic CI to v1 branch * chore: fix tests * chore: delete emulator workflow, docfx workflow
1 parent 39ea948 commit 57d07e1

File tree

16 files changed

+195
-177
lines changed

16 files changed

+195
-177
lines changed

.github/workflows/docs.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- v1
5+
name: docs
6+
jobs:
7+
docs:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
- name: Setup Python
13+
uses: actions/setup-python@v3
14+
with:
15+
python-version: "3.8"
16+
- name: Install nox
17+
run: |
18+
python -m pip install --upgrade setuptools pip wheel
19+
python -m pip install nox
20+
- name: Run docs
21+
run: |
22+
nox -s docs

.github/workflows/integration-tests-against-emulator.yaml

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

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- v1
5+
name: lint
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
- name: Setup Python
13+
uses: actions/setup-python@v3
14+
with:
15+
python-version: "3.8"
16+
- name: Install nox
17+
run: |
18+
python -m pip install --upgrade setuptools pip wheel
19+
python -m pip install nox
20+
- name: Run lint
21+
run: |
22+
nox -s lint
23+
- name: Run lint_setup_py
24+
run: |
25+
nox -s lint_setup_py

.github/workflows/unittest.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- v1
5+
name: unittest
6+
jobs:
7+
unit:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python: ['3.6', '3.7', '3.8']
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
- name: Setup Python
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: ${{ matrix.python }}
19+
- name: Install nox
20+
run: |
21+
python -m pip install --upgrade setuptools pip wheel
22+
python -m pip install nox
23+
- name: Run unit tests
24+
env:
25+
COVERAGE_FILE: .coverage-${{ matrix.python }}
26+
run: |
27+
nox -s unit-${{ matrix.python }}
28+
- name: Upload coverage results
29+
uses: actions/upload-artifact@v3
30+
with:
31+
name: coverage-artifacts
32+
path: .coverage-${{ matrix.python }}
33+
34+
cover:
35+
runs-on: ubuntu-latest
36+
needs:
37+
- unit
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
- name: Setup Python
42+
uses: actions/setup-python@v3
43+
with:
44+
python-version: "3.8"
45+
- name: Install coverage
46+
run: |
47+
python -m pip install --upgrade setuptools pip wheel
48+
python -m pip install coverage
49+
- name: Download coverage results
50+
uses: actions/download-artifact@v3
51+
with:
52+
name: coverage-artifacts
53+
path: .coverage-results/
54+
- name: Report coverage results
55+
run: |
56+
coverage combine .coverage-results/.coverage*
57+
coverage report --show-missing --fail-under=99

.kokoro/release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools
2626
export PYTHONUNBUFFERED=1
2727

2828
# Move into the package, build the distribution and upload.
29-
TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google_cloud_pypi_password")
29+
TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1")
3030
cd github/python-spanner
3131
python3 setup.py sdist bdist_wheel
32-
twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/*
32+
twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/*

.kokoro/release/common.cfg

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,18 @@ env_vars: {
2323
value: "github/python-spanner/.kokoro/release.sh"
2424
}
2525

26-
# Fetch the token needed for reporting release status to GitHub
27-
before_action {
28-
fetch_keystore {
29-
keystore_resource {
30-
keystore_config_id: 73713
31-
keyname: "yoshi-automation-github-key"
32-
}
33-
}
34-
}
35-
3626
# Fetch PyPI password
3727
before_action {
3828
fetch_keystore {
3929
keystore_resource {
4030
keystore_config_id: 73713
41-
keyname: "google_cloud_pypi_password"
31+
keyname: "google-cloud-pypi-token-keystore-1"
4232
}
4333
}
4434
}
4535

46-
# Fetch magictoken to use with Magic Github Proxy
47-
before_action {
48-
fetch_keystore {
49-
keystore_resource {
50-
keystore_config_id: 73713
51-
keyname: "releasetool-magictoken"
52-
}
53-
}
54-
}
55-
56-
# Fetch api key to use with Magic Github Proxy
57-
before_action {
58-
fetch_keystore {
59-
keystore_resource {
60-
keystore_config_id: 73713
61-
keyname: "magic-github-proxy-api-key"
62-
}
63-
}
36+
# Tokens needed to report release status back to GitHub
37+
env_vars: {
38+
key: "SECRET_MANAGER_KEYS"
39+
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
6440
}

google/cloud/spanner_admin_database_v1/proto/spanner_database_admin_pb2_grpc.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ class DatabaseAdminServicer(object):
128128
"""
129129

130130
def ListDatabases(self, request, context):
131-
"""Lists Cloud Spanner databases.
132-
"""
131+
"""Lists Cloud Spanner databases."""
133132
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
134133
context.set_details("Method not implemented!")
135134
raise NotImplementedError("Method not implemented!")
@@ -149,8 +148,7 @@ def CreateDatabase(self, request, context):
149148
raise NotImplementedError("Method not implemented!")
150149

151150
def GetDatabase(self, request, context):
152-
"""Gets the state of a Cloud Spanner database.
153-
"""
151+
"""Gets the state of a Cloud Spanner database."""
154152
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
155153
context.set_details("Method not implemented!")
156154
raise NotImplementedError("Method not implemented!")
@@ -248,22 +246,19 @@ def CreateBackup(self, request, context):
248246
raise NotImplementedError("Method not implemented!")
249247

250248
def GetBackup(self, request, context):
251-
"""Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
252-
"""
249+
"""Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]."""
253250
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
254251
context.set_details("Method not implemented!")
255252
raise NotImplementedError("Method not implemented!")
256253

257254
def UpdateBackup(self, request, context):
258-
"""Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
259-
"""
255+
"""Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]."""
260256
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
261257
context.set_details("Method not implemented!")
262258
raise NotImplementedError("Method not implemented!")
263259

264260
def DeleteBackup(self, request, context):
265-
"""Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
266-
"""
261+
"""Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]."""
267262
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
268263
context.set_details("Method not implemented!")
269264
raise NotImplementedError("Method not implemented!")

google/cloud/spanner_admin_instance_v1/proto/spanner_instance_admin_pb2_grpc.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,29 +120,25 @@ class InstanceAdminServicer(object):
120120
"""
121121

122122
def ListInstanceConfigs(self, request, context):
123-
"""Lists the supported instance configurations for a given project.
124-
"""
123+
"""Lists the supported instance configurations for a given project."""
125124
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
126125
context.set_details("Method not implemented!")
127126
raise NotImplementedError("Method not implemented!")
128127

129128
def GetInstanceConfig(self, request, context):
130-
"""Gets information about a particular instance configuration.
131-
"""
129+
"""Gets information about a particular instance configuration."""
132130
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
133131
context.set_details("Method not implemented!")
134132
raise NotImplementedError("Method not implemented!")
135133

136134
def ListInstances(self, request, context):
137-
"""Lists all instances in the given project.
138-
"""
135+
"""Lists all instances in the given project."""
139136
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
140137
context.set_details("Method not implemented!")
141138
raise NotImplementedError("Method not implemented!")
142139

143140
def GetInstance(self, request, context):
144-
"""Gets information about a particular instance.
145-
"""
141+
"""Gets information about a particular instance."""
146142
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
147143
context.set_details("Method not implemented!")
148144
raise NotImplementedError("Method not implemented!")

google/cloud/spanner_v1/batch.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ def delete(self, table, keyset):
120120

121121

122122
class Batch(_BatchBase):
123-
"""Accumulate mutations for transmission during :meth:`commit`.
124-
"""
123+
"""Accumulate mutations for transmission during :meth:`commit`."""
125124

126125
committed = None
127126
"""Timestamp at which the batch was successfully committed."""

google/cloud/spanner_v1/proto/spanner_pb2_grpc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ def GetSession(self, request, context):
156156
raise NotImplementedError("Method not implemented!")
157157

158158
def ListSessions(self, request, context):
159-
"""Lists all sessions in a given database.
160-
"""
159+
"""Lists all sessions in a given database."""
161160
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
162161
context.set_details("Method not implemented!")
163162
raise NotImplementedError("Method not implemented!")

0 commit comments

Comments
 (0)