Skip to content

Commit 10eddb6

Browse files
authored
refactor(tox): add extra-args input for tox and tox-docker (#72)
1 parent c8d6ecc commit 10eddb6

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

.github/workflows/tox-docker.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
on:
22
workflow_call:
3+
inputs:
4+
extra-args:
5+
description: >-
6+
Extra arguments to pass to tox.
7+
required: false
8+
type: string
9+
default: ''
310

411
jobs:
512
tox:
@@ -20,16 +27,17 @@ jobs:
2027
python -m pip install --requirement deps/requirements/tox.txt
2128
2229
- name: Set PY
30+
id: set-py
2331
run: |
24-
echo "PY=$(python --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
32+
echo "py=$(python --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT
2533
2634
- name: Cache tox
2735
id: cache-tox
2836
uses: actions/cache@v4
2937
with:
3038
path: .tox
31-
key: tox-${{ env.PY }}-${{ runner.os }}-${{ hashFiles('tox.ini') }}
39+
key: tox-${{ steps.set-py.outputs.py }}-${{ runner.os }}-${{ hashFiles('tox.ini') }}
3240

3341
- name: Run tests
3442
run: |
35-
tox
43+
tox ${{ inputs.extra-args }}

.github/workflows/tox.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ on:
66
Version range or exact version of Python to use, using SemVer's version range syntax.
77
required: true
88
type: string
9+
extra-args:
10+
description: >-
11+
Extra arguments to pass to tox.
12+
required: false
13+
type: string
14+
default: ''
15+
working-directory:
16+
description: >-
17+
The working directory to run tox in.
18+
required: false
19+
type: string
20+
default: ${{ github.workspace }}
921

1022
jobs:
1123
tox:
@@ -49,5 +61,6 @@ jobs:
4961
python-version: ${{ inputs.python-versions }}
5062

5163
- name: Run tests
64+
working-directory: ${{ inputs.working-directory }}
5265
run: |
53-
tox
66+
tox ${{ inputs.extra-args }}

0 commit comments

Comments
 (0)