Skip to content

Commit c58a43c

Browse files
committed
wip
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 065807f commit c58a43c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/python.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,10 @@ jobs:
223223
include:
224224
- os: macos-13
225225
python-version: "3.10"
226+
unittest-args: []
226227
- os: macos-13
227228
python-version: "3.9"
229+
unittest-args: []
228230
steps:
229231
- name: Checkout
230232
# see https://github.com/actions/checkout
@@ -236,6 +238,15 @@ jobs:
236238
uses: actions/setup-python@v5
237239
with:
238240
python-version: ${{ matrix.python-version }}
241+
- name: craft PY_UT_ARGS
242+
shell: python
243+
run: |-
244+
import sys
245+
PY_UT_ARGS=[]
246+
if sys.version_info >= (3, 12):
247+
PY_UT_ARGS.append('--durations=0')
248+
with open(os.environ['GITHUB_ENV'], 'a') as env_file:
249+
env_file.write(f'PY_UT_ARGS=${" ".join(PY_UT_ARGS)}\n')
239250
- name: Install poetry
240251
# see https://github.com/marketplace/actions/setup-poetry
241252
uses: Gr1N/setup-poetry@v9
@@ -246,7 +257,7 @@ jobs:
246257
- name: Ensure build successful
247258
run: poetry build
248259
- name: Run tox
249-
run: poetry run tox r -e py -s false
260+
run: poetry run -- tox r -e py -s false -- $PY_UT_ARGS
250261
- name: Generate coverage reports
251262
if: ${{ failure() || success() }}
252263
shell: bash

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ commands_pre =
2626
poetry install --no-root -v
2727
poetry run pip freeze
2828
commands =
29-
poetry run coverage run --source=cyclonedx_py -m unittest discover -t . -s tests -v --durations=0
29+
poetry run coverage run --source=cyclonedx_py -m unittest discover -t . -s tests -v {posargs}
3030
setenv =
3131
PYTHONHASHSEED=0
3232
CDX_TEST_RECREATE_SNAPSHOTS={env:CDX_TEST_RECREATE_SNAPSHOTS:}

0 commit comments

Comments
 (0)