Skip to content

Commit 2d74c17

Browse files
committed
Parameterize on python version matrix
1 parent 66d64d9 commit 2d74c17

File tree

4 files changed

+40
-23
lines changed

4 files changed

+40
-23
lines changed

.github/workflows/on-merge.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
unit-tests:
3535
uses: './.github/workflows/testing-unit.yaml'
3636
secrets: inherit
37+
with:
38+
python_versions_json: '["3.9", "3.13"]'
3739

3840
create-project:
3941
uses: './.github/workflows/project-setup.yaml'
@@ -49,7 +51,7 @@ jobs:
4951
- create-project
5052
with:
5153
encrypted_project_api_key: ${{ needs.create-project.outputs.encrypted_project_api_key }}
52-
54+
python_versions_json: '["3.9", "3.13"]'
5355
dependency-tests:
5456
uses: './.github/workflows/testing-dependency.yaml'
5557
secrets: inherit

.github/workflows/on-pr.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
unit-tests:
3232
uses: './.github/workflows/testing-unit.yaml'
3333
secrets: inherit
34+
with:
35+
python_versions_json: '["3.9"]'
3436

3537
create-project:
3638
uses: './.github/workflows/project-setup.yaml'
@@ -46,6 +48,7 @@ jobs:
4648
- create-project
4749
with:
4850
encrypted_project_api_key: ${{ needs.create-project.outputs.encrypted_project_api_key }}
51+
python_versions_json: '["3.9"]'
4952

5053
cleanup-project:
5154
if: ${{ always() }}

.github/workflows/testing-integration.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ on:
55
encrypted_project_api_key:
66
required: true
77
type: string
8+
python_versions_json:
9+
required: true
10+
type: string
811

912
permissions: {}
1013

1114
jobs:
1215
rest-sync:
13-
name: rest ${{ matrix.test_suite }}
16+
name: rest ${{ matrix.python_version }} ${{ matrix.test_suite }}
1417
runs-on: ubuntu-latest
1518
strategy:
1619
fail-fast: false
1720
max-parallel: 4
1821
matrix:
19-
python_version:
20-
- 3.9
22+
python_version: ${{ fromJson(inputs.python_versions_json) }}
2123
test_suite:
2224
- control/serverless
2325
- control/resources/index
@@ -43,14 +45,13 @@ jobs:
4345

4446

4547
rest-asyncio:
46-
name: asyncio ${{ matrix.test_suite }}
48+
name: asyncio ${{ matrix.python_version }} ${{ matrix.test_suite }}
4749
runs-on: ubuntu-latest
4850
strategy:
4951
fail-fast: false
5052
max-parallel: 4
5153
matrix:
52-
python_version:
53-
- 3.9
54+
python_version: ${{ fromJson(inputs.python_versions_json) }}
5455
test_suite:
5556
- control_asyncio/resources/index
5657
# - control_asyncio/resources/backup
@@ -78,9 +79,7 @@ jobs:
7879
strategy:
7980
fail-fast: false
8081
matrix:
81-
python_version:
82-
- 3.9
83-
- 3.13
82+
python_version: ${{ fromJson(inputs.python_versions_json) }}
8483
test_suite:
8584
- data
8685
steps:

.github/workflows/testing-unit.yaml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: "Unit Tests"
22
'on':
3-
workflow_call: {}
3+
workflow_call:
4+
inputs:
5+
python_versions_json:
6+
required: true
7+
type: string
48

59
jobs:
610
type-checking:
@@ -9,9 +13,7 @@ jobs:
913
strategy:
1014
fail-fast: true
1115
matrix:
12-
python-version:
13-
- 3.9
14-
- 3.13
16+
python-version: ${{ fromJson(inputs.python_versions_json) }}
1517
use_grpc:
1618
- true
1719
- false
@@ -28,28 +30,39 @@ jobs:
2830
run: poetry run mypy pinecone
2931

3032
unit-tests:
31-
name: Unit tests
33+
name: Unit (${{ matrix.python-version }})
3234
runs-on: ubuntu-latest
3335
strategy:
3436
fail-fast: true
3537
matrix:
36-
python-version:
37-
- 3.9
38-
- 3.13
39-
use_grpc:
40-
- true
41-
- false
38+
python-version: ${{ fromJson(inputs.python_versions_json) }}
4239
steps:
4340
- uses: actions/checkout@v4
4441
- name: Setup Poetry
4542
uses: ./.github/actions/setup-poetry
4643
with:
47-
include_grpc: '${{ matrix.use_grpc }}'
44+
include_grpc: false
4845
include_types: false
4946
include_asyncio: true
5047
python_version: '${{ matrix.python-version }}'
5148
- name: Run unit tests (REST)
5249
run: poetry run pytest --cov=pinecone --timeout=120 tests/unit --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG
50+
51+
grpc-unit-tests:
52+
name: Unit grpc (${{ matrix.python-version }})
53+
runs-on: ubuntu-latest
54+
strategy:
55+
fail-fast: true
56+
matrix:
57+
python-version: ${{ fromJson(inputs.python_versions_json) }}
58+
steps:
59+
- uses: actions/checkout@v4
60+
- name: Setup Poetry
61+
uses: ./.github/actions/setup-poetry
62+
with:
63+
include_grpc: true
64+
include_types: false
65+
include_asyncio: true
66+
python_version: '${{ matrix.python-version }}'
5367
- name: Run unit tests (GRPC)
54-
if: ${{ matrix.use_grpc == true }}
5568
run: poetry run pytest --cov=pinecone/grpc --timeout=120 tests/unit_grpc --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG

0 commit comments

Comments
 (0)