1- # encoding: utf-8
2-
31# This file is part of CycloneDX Python
42#
53# Licensed under the Apache License, Version 2.0 (the "License");
1715# SPDX-License-Identifier: Apache-2.0
1816# Copyright (c) OWASP Foundation. All Rights Reserved.
1917
18+ # For details of what checks are run for PRs please refer below
19+ # docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
20+
2021name : Python CI
2122
2223on :
@@ -51,13 +52,12 @@ jobs:
5152 steps :
5253 - name : Checkout
5354 # see https://github.com/actions/checkout
54- uses : actions/checkout@v4
55+ uses : actions/checkout@v5
5556 - name : Setup Python Environment
5657 # see https://github.com/actions/setup-python
5758 uses : actions/setup-python@v5
5859 with :
5960 python-version : ${{ env.PYTHON_VERSION_DEFAULT }}
60- architecture : ' x64'
6161 - name : Install poetry
6262 # see https://github.com/marketplace/actions/setup-poetry
6363 uses : Gr1N/setup-poetry@v9
@@ -75,13 +75,12 @@ jobs:
7575 steps :
7676 - name : Checkout
7777 # see https://github.com/actions/checkout
78- uses : actions/checkout@v4
78+ uses : actions/checkout@v5
7979 - name : Setup Python Environment
8080 # see https://github.com/actions/setup-python
8181 uses : actions/setup-python@v5
8282 with :
8383 python-version : ${{ env.PYTHON_VERSION_DEFAULT }}
84- architecture : ' x64'
8584 - name : Install poetry
8685 # see https://github.com/marketplace/actions/setup-poetry
8786 uses : Gr1N/setup-poetry@v9
@@ -99,13 +98,12 @@ jobs:
9998 steps :
10099 - name : Checkout
101100 # see https://github.com/actions/checkout
102- uses : actions/checkout@v4
101+ uses : actions/checkout@v5
103102 - name : Setup Python Environment
104103 # see https://github.com/actions/setup-python
105104 uses : actions/setup-python@v5
106105 with :
107106 python-version : ${{ env.PYTHON_VERSION_DEFAULT }}
108- architecture : ' x64'
109107 - name : Install poetry
110108 # see https://github.com/marketplace/actions/setup-poetry
111109 uses : Gr1N/setup-poetry@v9
@@ -133,13 +131,12 @@ jobs:
133131 steps :
134132 - name : Checkout
135133 # see https://github.com/actions/checkout
136- uses : actions/checkout@v4
134+ uses : actions/checkout@v5
137135 - name : Setup Python Environment
138136 # see https://github.com/actions/setup-python
139137 uses : actions/setup-python@v5
140138 with :
141139 python-version : ${{ matrix.python-version }}
142- architecture : ' x64'
143140 - name : Install poetry
144141 # see https://github.com/marketplace/actions/setup-poetry
145142 uses : Gr1N/setup-poetry@v9
@@ -157,13 +154,12 @@ jobs:
157154 steps :
158155 - name : Checkout
159156 # see https://github.com/actions/checkout
160- uses : actions/checkout@v4
157+ uses : actions/checkout@v5
161158 - name : Setup Python Environment
162159 # see https://github.com/actions/setup-python
163160 uses : actions/setup-python@v5
164161 with :
165162 python-version : ${{ env.PYTHON_VERSION_DEFAULT }}
166- architecture : ' x64'
167163 - name : Install poetry
168164 # see https://github.com/marketplace/actions/setup-poetry
169165 uses : Gr1N/setup-poetry@v9
@@ -191,13 +187,12 @@ jobs:
191187 steps :
192188 - name : Checkout
193189 # see https://github.com/actions/checkout
194- uses : actions/checkout@v4
190+ uses : actions/checkout@v5
195191 - name : Setup Python Environment
196192 # see https://github.com/actions/setup-python
197193 uses : actions/setup-python@v5
198194 with :
199195 python-version : ${{ env.PYTHON_VERSION_DEFAULT }}
200- architecture : ' x64'
201196 - name : Install self
202197 run : pip install .
203198 - name : run command
@@ -228,20 +223,30 @@ jobs:
228223 include :
229224 - os : macos-13
230225 python-version : " 3.10"
226+ unittest-args : []
231227 - os : macos-13
232228 python-version : " 3.9"
229+ unittest-args : []
233230 steps :
234231 - name : Checkout
235232 # see https://github.com/actions/checkout
236- uses : actions/checkout@v4
233+ uses : actions/checkout@v5
237234 - name : Create reports directory
238235 run : mkdir ${{ env.REPORTS_DIR }}
239236 - name : Setup Python Environment
240237 # see https://github.com/actions/setup-python
241238 uses : actions/setup-python@v5
242239 with :
243240 python-version : ${{ matrix.python-version }}
244- architecture : ' x64'
241+ - name : craft PY_UT_ARGS
242+ shell : python
243+ run : |-
244+ import sys, os
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')
245250 - name : Install poetry
246251 # see https://github.com/marketplace/actions/setup-poetry
247252 uses : Gr1N/setup-poetry@v9
@@ -252,7 +257,7 @@ jobs:
252257 - name : Ensure build successful
253258 run : poetry build
254259 - name : Run tox
255- run : poetry run tox r -e py -s false
260+ run : poetry run -- tox r -e py -s false -- $PY_UT_ARGS
256261 - name : Generate coverage reports
257262 if : ${{ failure() || success() }}
258263 shell : bash
@@ -277,7 +282,7 @@ jobs:
277282 steps :
278283 - name : fetch test artifacts
279284 # see https://github.com/actions/download-artifact
280- uses : actions/download-artifact@v4
285+ uses : actions/download-artifact@v5
281286 with :
282287 pattern : ' ${{ env.TESTS_REPORTS_ARTIFACT }}_bnt_*'
283288 merge-multiple : true
0 commit comments