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

Commit 6a9b268

Browse files
committed
update syntax
1 parent 37fd75c commit 6a9b268

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/tests.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ env:
1919
ALL_PYTHON: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
2020

2121
jobs:
22+
all_python_setup:
23+
outputs:
24+
all_python: ${{ steps.all_python_setup.outputs.all_python }}
25+
steps:
26+
- name: Set up all python
27+
id: all_python
28+
run: |
29+
all_python=$(echo ${{ vars.ALL_PYTHON }} | jq -Rrc 'split(",")')
30+
echo "all_python=$all_python" >> "$GITHUB_OUTPUT"
2231
docs:
2332
runs-on: ubuntu-latest
2433
steps:
@@ -35,11 +44,12 @@ jobs:
3544
- name: Build the documentation.
3645
run: nox -s docs
3746
mypy:
47+
needs: all_python_setup
3848
strategy:
3949
matrix:
4050
# Run mypy on all of the supported python versions listed in setup.py
4151
# https://github.com/python/mypy/blob/master/setup.py
42-
python: ${{ fromJSON(ALL_PYTHON) }}
52+
python: ${{ fromJSON(needs.all_python_setup.outputs.all_python) }}
4353
exclude:
4454
# Remove once https://github.com/googleapis/gapic-generator-python/issues/2303 is fixed
4555
- python: 3.7
@@ -56,11 +66,12 @@ jobs:
5666
- name: Check type annotations.
5767
run: nox -s mypy-${{ matrix.python }}
5868
showcase:
69+
needs: all_python_setup
5970
strategy:
6071
# Run showcase tests on the lowest and highest supported runtimes
6172
matrix:
6273
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2121) Remove `showcase_w_rest_async` target when async rest is GA.
63-
python: ["${{ fromJSON(ALL_PYTHON) }}[0]", "${{ fromJSON(ALL_PYTHON) }}[-1]"]
74+
python: ["${{ fromJSON(needs.all_python_setup.outputs.all_python) }}[0]", "${{ fromJSON(needs.all_python_setup.outputs.all_python) }}[-1]"]
6475
target: [showcase, showcase_w_rest_async]
6576
logging_scope: ["", "google"]
6677

@@ -149,9 +160,10 @@ jobs:
149160
nox -s ${{ matrix.target }}
150161
# TODO(yon-mg): add compute unit tests
151162
showcase-unit:
163+
needs: all_python_setup
152164
strategy:
153165
matrix:
154-
python: ${{ fromJSON(ALL_PYTHON) }}
166+
python: ${{ fromJSON(needs.all_python_setup.outputs.all_python) }}
155167
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2121) Remove `_w_rest_async` variant when async rest is GA.
156168
variant: ['', _alternative_templates, _mixins, _alternative_templates_mixins, _w_rest_async]
157169
logging_scope: ["", "google"]

0 commit comments

Comments
 (0)