Skip to content

Commit 51fb8bb

Browse files
committed
Allow us to expose all arguments in the generated matrix
1 parent 39a7c1d commit 51fb8bb

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ jobs:
6868
lint
6969
pkg
7070
py39-all:tox -f py39
71-
py39-arm64:tox -e py39:runner=ubuntu-24.04-arm64
71+
py39-arm64:tox -e py39:runner=ubuntu-24.04-arm64;foo=bar
7272
# ^ job-visible name : optional command : optional arguments
7373
# command can use ; as separator to run multiple commands
74-
# the only recognized argument is now 'runner'
74+
# 'runner' argument has special meaning, it is used to determine
75+
# the value of 'os' variable in the matrix job. Others are just
76+
# passed to the exploded matrix.
7577

7678
build:
7779
name: ${{ matrix.name }}
@@ -96,6 +98,18 @@ jobs:
9698
pip install tox
9799
98100
- run: ${{ matrix.command }}
101+
102+
- run: ${{ matrix.command2 }}
103+
if: ${{ matrix.command2 }}
104+
105+
- run: ${{ matrix.command3 }}
106+
if: ${{ matrix.command3 }}
107+
108+
- run: ${{ matrix.command4 }}
109+
if: ${{ matrix.command4 }}
110+
111+
- run: ${{ matrix.command5 }}
112+
if: ${{ matrix.command5 }}
99113
```
100114
101115
## Q&A

entrypoint.py

+2
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ def sort_key(s: str) -> tuple[int, str]:
157157
args["runner"] = PLATFORM_MAP[platform_name]
158158

159159
data = {
160+
# we expose all args in the output
161+
**args,
160162
"name": name,
161163
"command": commands[0],
162164
"python_version": "\n".join(pythons),

tests/test_action.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"INPUT_MACOS": "minmax",
2020
"INPUT_MAX_PYTHON": "3.8",
2121
"INPUT_MIN_PYTHON": "3.8",
22-
"INPUT_OTHER_NAMES": "z\nall-linux-arm64:tox -e py38-unit;tox -e py310-integration\nfoo::runner=custom-arm64",
22+
"INPUT_OTHER_NAMES": "z\nall-linux-arm64:tox -e py38-unit;tox -e py310-integration\nfoo::runner=custom-arm64;mise=true",
2323
"INPUT_PLATFORMS": "linux-arm64:ubuntu-24.04-arm64-2core",
2424
"INPUT_SKIP_EXPLODE": "1",
2525
"INPUT_WINDOWS": "minmax",

0 commit comments

Comments
 (0)