Skip to content

Commit 8e9288a

Browse files
build: move unit tests to Github Actions (#373)
1 parent 0111dd3 commit 8e9288a

File tree

6 files changed

+53
-9
lines changed

6 files changed

+53
-9
lines changed

.github/workflows/tests.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
15+
name: tests
16+
on:
17+
pull_request:
18+
push:
19+
branches:
20+
- main
21+
22+
jobs:
23+
build:
24+
name: "unit tests"
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
matrix:
28+
os: [macos-latest, windows-latest, ubuntu-latest]
29+
python-version: ["3.7", "3.8", "3.9", "3.10"]
30+
fail-fast: false
31+
steps:
32+
- name: Setup Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v3
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
37+
- name: Install nox
38+
run: pip install nox
39+
40+
- name: Checkout code
41+
uses: actions/checkout@v3
42+
43+
- name: Run tests
44+
run: nox -s unit-${{ matrix.python-version }}

.kokoro/python3.10/linux/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ env_vars: {
3737
# Specify which tests to run
3838
env_vars: {
3939
key: "RUN_TESTS_SESSION"
40-
value: "test-3.10"
40+
value: "system-3.10"
4141
}

.kokoro/python3.7/linux/common.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ env_vars: {
3737
# Specify which tests to run
3838
env_vars: {
3939
key: "RUN_TESTS_SESSION"
40-
value: "test-3.7"
41-
}
40+
value: "system-3.7"
41+
}

.kokoro/python3.7/windows/common.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ build_file: "cloud-sql-python-connector/.kokoro/tests/run_tests.bat"
2424
# Specify which tests to run
2525
env_vars: {
2626
key: "RUN_TESTS_SESSION"
27-
value: "test-3.7"
28-
}
27+
value: "system-3.7"
28+
}

.kokoro/python3.8/linux/common.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ env_vars: {
3737
# Specify which tests to run
3838
env_vars: {
3939
key: "RUN_TESTS_SESSION"
40-
value: "test-3.8"
41-
}
40+
value: "system-3.8"
41+
}

.kokoro/python3.9/linux/common.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ env_vars: {
3737
# Specify which tests to run
3838
env_vars: {
3939
key: "RUN_TESTS_SESSION"
40-
value: "test-3.9"
41-
}
40+
value: "system-3.9"
41+
}

0 commit comments

Comments
 (0)