Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 3e7e418

Browse files
committed
update syntax
1 parent 08d7eb6 commit 3e7e418

File tree

1 file changed

+35
-32
lines changed

1 file changed

+35
-32
lines changed

.github/workflows/tests.yaml

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ env:
1717
SHOWCASE_VERSION: 0.35.0
1818
PROTOC_VERSION: 3.20.2
1919
ALL_PYTHON: '"3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"'
20+
# Use Python 3.10 for docs to match the version for the sphinx plugin
21+
# https://github.com/googleapis/synthtool/pull/1891
22+
DOCS_PYTHON: "3.10"
23+
OLDEST_PYTHON: "3.7"
24+
NEWEST_STABLE_PYTHON: "3.13"
25+
PRERELEASE_PYTHON: "3.14"
2026

2127
jobs:
2228
all_python_setup:
@@ -35,10 +41,8 @@ jobs:
3541
- uses: actions/checkout@v4
3642
- name: Set up Python
3743
uses: actions/setup-python@v5
38-
# Use python 3.10 for docs to match the version for the sphinx plugin
39-
# https://github.com/googleapis/synthtool/pull/1891
4044
with:
41-
python-version: "3.10"
45+
python-version: "${DOCS_PYTHON}"
4246
cache: 'pip'
4347
- name: Install nox.
4448
run: python -m pip install nox
@@ -72,7 +76,7 @@ jobs:
7276
# Run showcase tests on the lowest and highest supported runtimes
7377
matrix:
7478
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2121) Remove `showcase_w_rest_async` target when async rest is GA.
75-
python: ["${{ fromJSON(needs.all_python_setup.outputs.all_python) }}[0]", "${{ fromJSON(needs.all_python_setup.outputs.all_python) }}[-1]"]
79+
python: ["${OLDEST_PYTHON}", "${NEWEST_STABLE_PYTHON}"]
7680
target: [showcase, showcase_w_rest_async]
7781
logging_scope: ["", "google"]
7882

@@ -127,10 +131,10 @@ jobs:
127131
run: |
128132
sudo mkdir -p /tmp/workspace/tests/cert/
129133
sudo chown -R ${USER} /tmp/workspace/
130-
- name: Set up Python "3.13"
134+
- name: Set up Python ${NEWEST_STABLE_PYTHON}
131135
uses: actions/setup-python@v5
132136
with:
133-
python-version: "3.13"
137+
python-version: "${NEWEST_STABLE_PYTHON}"
134138
cache: 'pip'
135139
- name: Copy mtls files
136140
run: cp tests/cert/mtls.* /tmp/workspace/tests/cert/
@@ -202,10 +206,10 @@ jobs:
202206
runs-on: ubuntu-latest
203207
steps:
204208
- uses: actions/checkout@v4
205-
- name: Set up Python "3.13"
209+
- name: Set up Python ${NEWEST_STABLE_PYTHON}
206210
uses: actions/setup-python@v5
207211
with:
208-
python-version: "3.13"
212+
python-version: "${NEWEST_STABLE_PYTHON}"
209213
cache: 'pip'
210214
- name: Install system dependencies.
211215
run: |
@@ -230,10 +234,10 @@ jobs:
230234
variant: ['', _alternative_templates]
231235
steps:
232236
- uses: actions/checkout@v4
233-
- name: Set up Python "3.13"
237+
- name: Set up Python ${NEWEST_STABLE_PYTHON}
234238
uses: actions/setup-python@v5
235239
with:
236-
python-version: "3.13"
240+
python-version: "${NEWEST_STABLE_PYTHON}"
237241
cache: 'pip'
238242
- name: Install system dependencies.
239243
run: |
@@ -255,10 +259,10 @@ jobs:
255259
runs-on: ubuntu-latest
256260
steps:
257261
- uses: actions/checkout@v4
258-
- name: Set up Python "3.13"
262+
- name: Set up Python ${NEWEST_STABLE_PYTHON}
259263
uses: actions/setup-python@v5
260264
with:
261-
python-version: "3.13"
265+
python-version: "${NEWEST_STABLE_PYTHON}"
262266
cache: 'pip'
263267
- name: Install system dependencies.
264268
run: |
@@ -271,8 +275,7 @@ jobs:
271275
unit:
272276
strategy:
273277
matrix:
274-
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
275-
278+
python: [${{ fromJSON(needs.all_python_setup.outputs.all_python) }}]
276279
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed.
277280
# Use ubuntu-22.04 until Python 3.7 is removed from the test matrix
278281
runs-on: ubuntu-22.04
@@ -295,7 +298,7 @@ jobs:
295298
fragment:
296299
strategy:
297300
matrix:
298-
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
301+
python: [${{ fromJSON(needs.all_python_setup.outputs.all_python) }}]
299302
variant: ['', _alternative_templates]
300303

301304
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed.
@@ -350,29 +353,29 @@ jobs:
350353
runs-on: ubuntu-latest
351354
steps:
352355
- uses: actions/checkout@v4
353-
- name: Set up Python 3.13
356+
- name: Set up Python ${NEWEST_STABLE_PYTHON}
354357
uses: actions/setup-python@v5
355358
with:
356-
python-version: "3.13"
359+
python-version: ${NEWEST_STABLE_PYTHON}
357360
cache: 'pip'
358361
- name: Install nox.
359362
run: |
360363
python -m pip install nox
361364
- name: Run blacken and lint on the generated output.
362365
run: |
363-
nox -f tests/integration/goldens/asset/noxfile.py -s mypy-3.13 blacken lint
364-
nox -f tests/integration/goldens/credentials/noxfile.py -s mypy-3.13 blacken lint
365-
nox -f tests/integration/goldens/eventarc/noxfile.py -s mypy-3.13 blacken lint
366-
nox -f tests/integration/goldens/logging/noxfile.py -s mypy-3.13 blacken lint
367-
nox -f tests/integration/goldens/redis/noxfile.py -s mypy-3.13 blacken lint
366+
nox -f tests/integration/goldens/asset/noxfile.py -s mypy-${NEWEST_STABLE_PYTHON} blacken lint
367+
nox -f tests/integration/goldens/credentials/noxfile.py -s mypy-${NEWEST_STABLE_PYTHON} blacken lint
368+
nox -f tests/integration/goldens/eventarc/noxfile.py -s mypy-${NEWEST_STABLE_PYTHON} blacken lint
369+
nox -f tests/integration/goldens/logging/noxfile.py -s mypy-${NEWEST_STABLE_PYTHON} blacken lint
370+
nox -f tests/integration/goldens/redis/noxfile.py -s mypy-${NEWEST_STABLE_PYTHON} blacken lint
368371
goldens-unit:
369372
runs-on: ubuntu-latest
370373
steps:
371374
- uses: actions/checkout@v4
372-
- name: Set up Python 3.13
375+
- name: Set up Python "${NEWEST_STABLE_PYTHON}"
373376
uses: actions/setup-python@v5
374377
with:
375-
python-version: "3.13"
378+
python-version: "${NEWEST_STABLE_PYTHON}"
376379
cache: 'pip'
377380
- name: Install nox.
378381
run: |
@@ -382,18 +385,18 @@ jobs:
382385
# in order to run unit tests
383386
# See https://github.com/googleapis/gapic-generator-python/issues/1806
384387
run: |
385-
nox -f tests/integration/goldens/credentials/noxfile.py -s unit-3.13
386-
nox -f tests/integration/goldens/eventarc/noxfile.py -s unit-3.13
387-
nox -f tests/integration/goldens/logging/noxfile.py -s unit-3.13
388-
nox -f tests/integration/goldens/redis/noxfile.py -s unit-3.13
388+
nox -f tests/integration/goldens/credentials/noxfile.py -s unit-${NEWEST_STABLE_PYTHON}
389+
nox -f tests/integration/goldens/eventarc/noxfile.py -s unit-${NEWEST_STABLE_PYTHON}
390+
nox -f tests/integration/goldens/logging/noxfile.py -s unit-${NEWEST_STABLE_PYTHON}
391+
nox -f tests/integration/goldens/redis/noxfile.py -s unit-${NEWEST_STABLE_PYTHON}
389392
goldens-prerelease:
390393
runs-on: ubuntu-latest
391394
steps:
392395
- uses: actions/checkout@v4
393-
- name: Set up Python 3.13
396+
- name: Set up Python ${PRERELEASE_PYTHON}
394397
uses: actions/setup-python@v5
395398
with:
396-
python-version: "3.13"
399+
python-version: "${PRERELEASE_PYTHON}"
397400
cache: 'pip'
398401
- name: Install nox.
399402
run: |
@@ -411,10 +414,10 @@ jobs:
411414
runs-on: ubuntu-latest
412415
steps:
413416
- uses: actions/checkout@v4
414-
- name: Set up Python "3.13"
417+
- name: Set up Python "${NEWEST_STABLE_PYTHON}"
415418
uses: actions/setup-python@v5
416419
with:
417-
python-version: "3.13"
420+
python-version: "${NEWEST_STABLE_PYTHON}"
418421
cache: 'pip'
419422
- name: Install nox.
420423
run: |

0 commit comments

Comments
 (0)