Skip to content

Commit 8dc3d15

Browse files
committed
build: move some checks to GitHub Actions
1 parent ae41bef commit 8dc3d15

File tree

3 files changed

+52
-2
lines changed

3 files changed

+52
-2
lines changed

.github/workflows/presubmit.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
name: Presubmit checks
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
- name: Setup Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: 3.8
18+
- name: Install nox
19+
run: python -m pip install nox
20+
- name: Check formatting
21+
run: nox -s lint
22+
- name: Check lint setup
23+
run: nox -s lint_setup_py
24+
units:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
python: [3.8, 3.9, 3.10, 3.11, 3.12, 3.13]
30+
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
- name: Setup Python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{matrix.python}}
38+
- name: Install nox
39+
run: python -m pip install nox
40+
- name: Run unit tests
41+
run: nox -s unit-${{matrix.python}}

.kokoro/presubmit/presubmit.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ env_vars: {
55
key: "RUN_SYSTEM_TESTS"
66
value: "false"
77
}
8+
# Only run a subset of all nox sessions
9+
env_vars: {
10+
key: "NOX_SESSION"
11+
value: "unit-3.8 unit-3.12 cover docs docfx"
12+
}

noxfile.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,12 @@ def system(session, protobuf_implementation, database_dialect):
329329
session.skip(
330330
"Credentials or emulator host must be set via environment variable"
331331
)
332-
if not os.environ.get("SPANNER_EMULATOR_HOST"):
333-
session.skip("only run system tests on the emulator to speed the build up")
332+
if not (
333+
os.environ.get("SPANNER_EMULATOR_HOST") or protobuf_implementation == "python"
334+
):
335+
session.skip(
336+
"Only run system tests on real Spanner with one protobuf implementation to speed up the build"
337+
)
334338

335339
# Install pyopenssl for mTLS testing.
336340
if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true":

0 commit comments

Comments
 (0)