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

Commit 6aac984

Browse files
committed
update syntax
1 parent 7cf70c4 commit 6aac984

File tree

1 file changed

+25
-35
lines changed

1 file changed

+25
-35
lines changed

.github/workflows/tests.yaml

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ env:
2020
# Use Python 3.10 for docs to match the version for the sphinx plugin
2121
# https://github.com/googleapis/synthtool/pull/1891
2222
DOCS_PYTHON: "3.10"
23+
OLDEST_PYTHON: "3.7"
2324
NEWEST_STABLE_PYTHON: "3.13"
2425
PRERELEASE_PYTHON: "3.14"
2526

@@ -34,16 +35,6 @@ jobs:
3435
run: |
3536
all_python=$(echo ${{ vars.ALL_PYTHON }} | jq -Rrc 'split(",")')
3637
echo "all_python=$all_python" >> "$GITHUB_OUTPUT"
37-
newest_oldest_python_setup:
38-
runs-on: ubuntu-latest
39-
outputs:
40-
all_python: ${{ steps.newest_oldest_python.outputs.all_python }}
41-
steps:
42-
- name: Set up newest and oldest python
43-
id: newest_oldest_python_setup
44-
run: |
45-
newest_oldest_python=$(echo ${{ vars.ALL_PYTHON }} | jq -Rrc 'split(",")[0, -1]' )
46-
echo "newest_oldest_python=$newest_oldest_python" >> "$GITHUB_OUTPUT"
4738
docs:
4839
runs-on: ubuntu-latest
4940
steps:
@@ -80,12 +71,11 @@ jobs:
8071
- name: Check type annotations.
8172
run: nox -s mypy-${{ matrix.python }}
8273
showcase:
83-
needs: newest_oldest_python_setup
8474
strategy:
8575
# Run showcase tests on the lowest and highest supported runtimes
8676
matrix:
8777
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2121) Remove `showcase_w_rest_async` target when async rest is GA.
88-
python: ${{ fromJSON(needs.newest_oldest_python_setup.outputs.newest_oldest_python) }}
78+
python: [${{ vars.OLDEST_PYTHON }}, ${{ vars.NEWEST_STABLE_PYTHON }}]
8979
target: [showcase, showcase_w_rest_async]
9080
logging_scope: ["", "google"]
9181

@@ -140,10 +130,10 @@ jobs:
140130
run: |
141131
sudo mkdir -p /tmp/workspace/tests/cert/
142132
sudo chown -R ${USER} /tmp/workspace/
143-
- name: Set up Python ${{NEWEST_STABLE_PYTHON}}
133+
- name: Set up Python ${{ vars.NEWEST_STABLE_PYTHON }}
144134
uses: actions/setup-python@v5
145135
with:
146-
python-version: ${{NEWEST_STABLE_PYTHON}}
136+
python-version: ${{ vars.NEWEST_STABLE_PYTHON }}
147137
cache: 'pip'
148138
- name: Copy mtls files
149139
run: cp tests/cert/mtls.* /tmp/workspace/tests/cert/
@@ -215,10 +205,10 @@ jobs:
215205
runs-on: ubuntu-latest
216206
steps:
217207
- uses: actions/checkout@v4
218-
- name: Set up Python ${NEWEST_STABLE_PYTHON}
208+
- name: Set up Python ${{ vars.NEWEST_STABLE_PYTHON }}
219209
uses: actions/setup-python@v5
220210
with:
221-
python-version: ${NEWEST_STABLE_PYTHON}
211+
python-version: ${{ vars.NEWEST_STABLE_PYTHON }}
222212
cache: 'pip'
223213
- name: Install system dependencies.
224214
run: |
@@ -243,10 +233,10 @@ jobs:
243233
variant: ['', _alternative_templates]
244234
steps:
245235
- uses: actions/checkout@v4
246-
- name: Set up Python ${NEWEST_STABLE_PYTHON}
236+
- name: Set up Python ${{ vars.NEWEST_STABLE_PYTHON }}
247237
uses: actions/setup-python@v5
248238
with:
249-
python-version: ${NEWEST_STABLE_PYTHON}
239+
python-version: ${{ vars.NEWEST_STABLE_PYTHON }}
250240
cache: 'pip'
251241
- name: Install system dependencies.
252242
run: |
@@ -268,10 +258,10 @@ jobs:
268258
runs-on: ubuntu-latest
269259
steps:
270260
- uses: actions/checkout@v4
271-
- name: Set up Python ${NEWEST_STABLE_PYTHON}
261+
- name: Set up Python ${{ vars.NEWEST_STABLE_PYTHON }}
272262
uses: actions/setup-python@v5
273263
with:
274-
python-version: ${NEWEST_STABLE_PYTHON}
264+
python-version: ${{ vars.NEWEST_STABLE_PYTHON }}
275265
cache: 'pip'
276266
- name: Install system dependencies.
277267
run: |
@@ -364,29 +354,29 @@ jobs:
364354
runs-on: ubuntu-latest
365355
steps:
366356
- uses: actions/checkout@v4
367-
- name: Set up Python ${NEWEST_STABLE_PYTHON}
357+
- name: Set up Python ${{ vars.NEWEST_STABLE_PYTHON }}
368358
uses: actions/setup-python@v5
369359
with:
370-
python-version: ${NEWEST_STABLE_PYTHON}
360+
python-version: ${{ vars.NEWEST_STABLE_PYTHON }}
371361
cache: 'pip'
372362
- name: Install nox.
373363
run: |
374364
python -m pip install nox
375365
- name: Run blacken and lint on the generated output.
376366
run: |
377-
nox -f tests/integration/goldens/asset/noxfile.py -s mypy-${NEWEST_STABLE_PYTHON} blacken lint
378-
nox -f tests/integration/goldens/credentials/noxfile.py -s mypy-${NEWEST_STABLE_PYTHON} blacken lint
379-
nox -f tests/integration/goldens/eventarc/noxfile.py -s mypy-${NEWEST_STABLE_PYTHON} blacken lint
380-
nox -f tests/integration/goldens/logging/noxfile.py -s mypy-${NEWEST_STABLE_PYTHON} blacken lint
381-
nox -f tests/integration/goldens/redis/noxfile.py -s mypy-${NEWEST_STABLE_PYTHON} blacken lint
367+
nox -f tests/integration/goldens/asset/noxfile.py -s mypy-${{ vars.NEWEST_STABLE_PYTHON }} blacken lint
368+
nox -f tests/integration/goldens/credentials/noxfile.py -s mypy-${{ vars.NEWEST_STABLE_PYTHON }} blacken lint
369+
nox -f tests/integration/goldens/eventarc/noxfile.py -s mypy-${{ vars.NEWEST_STABLE_PYTHON }} blacken lint
370+
nox -f tests/integration/goldens/logging/noxfile.py -s mypy-${{ vars.NEWEST_STABLE_PYTHON }} blacken lint
371+
nox -f tests/integration/goldens/redis/noxfile.py -s mypy-${{ vars.NEWEST_STABLE_PYTHON }} blacken lint
382372
goldens-unit:
383373
runs-on: ubuntu-latest
384374
steps:
385375
- uses: actions/checkout@v4
386-
- name: Set up Python ${NEWEST_STABLE_PYTHON}
376+
- name: Set up Python ${{ vars.NEWEST_STABLE_PYTHON }}
387377
uses: actions/setup-python@v5
388378
with:
389-
python-version: ${NEWEST_STABLE_PYTHON}
379+
python-version: ${{ vars.NEWEST_STABLE_PYTHON }}
390380
cache: 'pip'
391381
- name: Install nox.
392382
run: |
@@ -396,10 +386,10 @@ jobs:
396386
# in order to run unit tests
397387
# See https://github.com/googleapis/gapic-generator-python/issues/1806
398388
run: |
399-
nox -f tests/integration/goldens/credentials/noxfile.py -s unit-${NEWEST_STABLE_PYTHON}
400-
nox -f tests/integration/goldens/eventarc/noxfile.py -s unit-${NEWEST_STABLE_PYTHON}
401-
nox -f tests/integration/goldens/logging/noxfile.py -s unit-${NEWEST_STABLE_PYTHON}
402-
nox -f tests/integration/goldens/redis/noxfile.py -s unit-${NEWEST_STABLE_PYTHON}
389+
nox -f tests/integration/goldens/credentials/noxfile.py -s unit-${{ vars.NEWEST_STABLE_PYTHON }}
390+
nox -f tests/integration/goldens/eventarc/noxfile.py -s unit-${{ vars.NEWEST_STABLE_PYTHON }}
391+
nox -f tests/integration/goldens/logging/noxfile.py -s unit-${{ vars.NEWEST_STABLE_PYTHON }}
392+
nox -f tests/integration/goldens/redis/noxfile.py -s unit-${{ vars.NEWEST_STABLE_PYTHON }}
403393
goldens-prerelease:
404394
runs-on: ubuntu-latest
405395
steps:
@@ -425,10 +415,10 @@ jobs:
425415
runs-on: ubuntu-latest
426416
steps:
427417
- uses: actions/checkout@v4
428-
- name: Set up Python ${NEWEST_STABLE_PYTHON}
418+
- name: Set up Python ${{ vars.NEWEST_STABLE_PYTHON }}
429419
uses: actions/setup-python@v5
430420
with:
431-
python-version: ${NEWEST_STABLE_PYTHON}
421+
python-version: ${{ vars.NEWEST_STABLE_PYTHON }}
432422
cache: 'pip'
433423
- name: Install nox.
434424
run: |

0 commit comments

Comments
 (0)