Skip to content

Commit ddbeae8

Browse files
[PATCH] Various improvements to CI/CD (- WIP #338 -)
Additions with file .github/actions/fetch-test-reporter/action.yml: * implemented fetch action of GHI #130 Additions with file .github/tools/fetch-test-reporter: * added submodule for implementing GHI #130 Additions with file .gitmodules: * added submodule for implementing GHI #130 Changes in file .github/workflows/Tests.yml: * minor tweaks * related work Changes in file tests/check_pip: * followup improvements related to fixing GHI #400 * refactor cioutput usage to hopefully handle venv stuff * Implement handling traversing git directories and venv * Add possible alternitive apache-2 license label to allowed list
1 parent 741ab38 commit ddbeae8

File tree

6 files changed

+153
-59
lines changed

6 files changed

+153
-59
lines changed

.github/actions/checkout-and-rebuild/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ runs:
6363
with:
6464
persist-credentials: false
6565
fetch-depth: 0
66+
submodules: true
6667
path: ${{ inputs.path }}
6768
repository: reactive-firewall/multicast
6869
token: ${{ inputs.token }}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: 'Fetch Code Coverage Tools'
3+
description: 'Fetch various Code Coverage tools'
4+
author: 'Mr. Walls'
5+
branding:
6+
icon: 'download-cloud'
7+
color: 'blue'
8+
inputs:
9+
token:
10+
description: |
11+
The token used to authenticate when performing GitHub API operations.
12+
When running this action on github.com, the default value is sufficient. When running on
13+
GHES, you can pass a personal access token for github.com if you are experiencing
14+
rate limiting.
15+
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
16+
required: true
17+
outputs:
18+
sha:
19+
description: "The SHA of the commit checked-out"
20+
value: ${{ steps.output_sha.outputs.sha || 'HEAD' }}
21+
can_fetch:
22+
description: "Can the fetch tool even be used?"
23+
value: ${{ steps.output_can_fetch.outputs.can_fetch || 'false' }}
24+
status:
25+
description: "The outcome of the fetch test reporter action."
26+
value: ${{ steps.fetch_outcome.outputs.status || 'cancelled' }}
27+
28+
runs:
29+
using: composite
30+
steps:
31+
- name: "Calculate Commit SHA"
32+
id: output_sha
33+
shell: bash
34+
run: |
35+
printf "sha=%s\n" $(git rev-parse --verify HEAD) >> "$GITHUB_OUTPUT"
36+
printf "FETCH_SHA=%s\n" $(git rev-parse --verify HEAD) >> "$GITHUB_ENV"
37+
- name: "Check has Fetch Tool"
38+
id: output_can_fetch
39+
shell: bash
40+
run: |
41+
if [[ -x ${{ github.workspace }}/.github/tools/fetch-test-reporter/fetch-test-reporter ]] ; then
42+
printf "can_fetch=true\n" >> "$GITHUB_OUTPUT"
43+
printf "::debug::%s\n" "Found ${{ github.workspace }}/.github/tools/fetch-test-reporter/fetch-test-reporter"
44+
else
45+
printf "::warning, title='Missing tool':: %s\n" "Can't find fetch-test-reporter tool."
46+
printf "can_fetch=false\n" >> "$GITHUB_OUTPUT"
47+
fi
48+
- name: "Install test reporter tools on ${{ runner.os }}"
49+
id: fetch-test-reporter-main
50+
if: ${{ !cancelled() && (steps.output_can_fetch.outputs.can_fetch == 'true') && (runner.os != 'Windows') && (github.repository == 'reactive-firewall/multicast') }}
51+
shell: bash
52+
env:
53+
CODECLIMATE_REPO_TOKEN: ${{ github.server_url == 'https://github.com' && secrets.CODECLIMATE_TOKEN || '' }}
54+
CC_TEST_REPORTER_ID: ${{ github.server_url == 'https://github.com' && secrets.CC_TEST_REPORTER_ID || '' }}
55+
DEEPSOURCE_DSN: ${{ github.server_url == 'https://github.com' && secrets.DEEPSOURCE_DSN || '' }}
56+
run: |
57+
${{ github.workspace }}/.github/tools/fetch-test-reporter/fetch-test-reporter || exit $?
58+
- name: "Evaluate Fetch Task"
59+
id: fetch_outcome
60+
if: ${{ !cancelled() }}
61+
shell: bash
62+
run: |
63+
if [[ "${{ steps.output_can_fetch.outputs.can_fetch }}" == "true" ]] ; then
64+
if [[ "${{ steps.fetch-test-reporter-main.outcome }}" == "success" ]] ; then
65+
THE_RESULT="success"
66+
else
67+
THE_RESULT="failure"
68+
fi
69+
else
70+
THE_RESULT="skipped"
71+
fi
72+
printf "status=%s\n" "${THE_RESULT}" >> "$GITHUB_OUTPUT"
73+
if [[ "${THE_RESULT}" == "failure" ]] ; then
74+
exit 1
75+
else
76+
exit 0
77+
fi

.github/tools/fetch-test-reporter

Submodule fetch-test-reporter added at 73f6d6b

.github/workflows/Tests.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484
run-id: ${{ steps.get_trigger_id.outputs.trigger_id }}
8585
- name: "move into place"
8686
id: load_build_info
87+
if: ${{ (github.repository == 'reactive-firewall/multicast') && success() }}
8788
run: |
8889
mv -vf "multicast-info.txt/multicast-info.txt" ./"multicast-info-tmp.txt" ;
8990
wait ;
@@ -137,23 +138,11 @@ jobs:
137138
build-run-id: ${{ needs.check_mats.outputs.build_id }}
138139
python-version: ${{ matrix.python-version }}
139140
path: ${{ github.workspace }}
140-
- name: Install code-climate tools for ${{ matrix.python-version }} on ${{ matrix.os }}
141-
if: ${{ !cancelled() && runner.os == 'Linux' }}
142-
shell: bash
143-
env:
144-
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
145-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
146-
run: |
147-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter || true ;
148-
chmod +x ./cc-test-reporter 2>/dev/null || true ;
149-
./cc-test-reporter before-build || true ;
150-
- name: Install deepsource tools for ${{ matrix.python-version }} on ${{ matrix.os }}
151-
if: ${{ !cancelled() && runner.os == 'Linux' }}
152-
shell: bash
153-
env:
154-
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
155-
run: |
156-
(curl https://deepsource.io/cli | sh) || true ;
141+
- name: Install coverage tools for ${{ matrix.python-version }} on ${{ matrix.os }}
142+
id: fetch-test-tools
143+
uses: ./.github/actions/fetch-test-reporter
144+
with:
145+
token: ${{ github.server_url == 'https://github.com' && github.token || '' }}
157146
- name: Pre-Clean
158147
id: clean
159148
run: make -j1 -f Makefile clean || true ;
@@ -194,7 +183,7 @@ jobs:
194183
path: ./test-reports/
195184
if-no-files-found: ignore
196185
- name: code-climate for ${{ matrix.python-version }} on ${{ matrix.os }}
197-
if: ${{ !cancelled() && runner.os == 'Linux' }}
186+
if: ${{ !cancelled() && runner.os != 'Windows' }}
198187
shell: bash
199188
env:
200189
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "fetch-test-reporter"]
2+
path = .github/tools/fetch-test-reporter
3+
url = https://gist.github.com/c718380a1747d43dda1519167fc50ac0.git
4+
ignore = dirty

tests/check_pip

Lines changed: 63 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ else
168168
fi
169169
check_command pip-licenses ;
170170
check_command shlock ;
171-
172171
# Set default exitcode to failure until sure we won't need to abort
173172
EXIT_CODE=1
174173

@@ -224,13 +223,33 @@ function handle_signals() {
224223
handle_signals
225224

226225
# lazy defined variables should be defined now that this is the only script instance.
226+
# identify git root
227+
if GIT_ROOT_DIR=$(git rev-parse --show-superproject-working-tree 2>/dev/null); then
228+
if [ -z "${GIT_ROOT_DIR}" ]; then
229+
GIT_ROOT_DIR=$(git rev-parse --show-toplevel 2>/dev/null)
230+
fi
231+
else
232+
python3 -B .github/tools/cioutput.py -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "FAIL" "Missing valid repository or source structure." >&2
233+
EXIT_CODE=40
234+
fi
235+
236+
CIOUTPUT_PY=".github/tools/cioutput.py"
237+
# check for tool by full path
238+
if [[ ( -r ${GIT_ROOT_DIR}/.github/tools/cioutput.py ) ]] ; then
239+
# set absolute path to .github/tools/cioutput.py
240+
CIOUTPUT_PY=${GIT_ROOT_DIR}/.github/tools/cioutput.py
241+
else
242+
python3 -B .github/tools/cioutput.py -l info --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "SKIP" "Required CI Output tool can not be found." >&2 ;
243+
EXIT_CODE=126
244+
fi
245+
227246

228247
# set the script-file to check_pip
229248
SCRIPT_FILE="tests/check_pip"
230249
# Set pip-audit options
231250
AUDIT_OPTIONS="--progress-spinner off --desc on --requirement"
232251
# List of Allowed Licenses delimited by semicolon ;
233-
ALLOW_LICENSES="Public Domain;Apache Software License;MIT License;BSD License;Python Software Foundation License;The Unlicense (Unlicense);Mozilla Public License 2.0 (MPL 2.0);"
252+
ALLOW_LICENSES="Public Domain;Apache Software License;Apache-2.0;MIT License;BSD License;Python Software Foundation License;The Unlicense (Unlicense);Mozilla Public License 2.0 (MPL 2.0);"
234253
# Set pip-licenses options
235254
LICENSE_OPTIONS="--from=mixed"
236255
# Set pip options
@@ -244,10 +263,12 @@ else
244263
PIP_ENV_FLAGS=""
245264
LICENSE_OPTIONS="${LICENSE_OPTIONS} --ignore-packages chardet"
246265
fi ;
266+
# urllib is licensed under MIT, but reports "UNKNOWN"
267+
LICENSE_OPTIONS="${LICENSE_OPTIONS} --ignore-packages urllib3"
247268
# Enable auto-fix if '--fix' argument is provided
248269
if [[ "$1" == "--fix" ]]; then
249270
AUDIT_OPTIONS="--fix --strict ${AUDIT_OPTIONS}"
250-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "Auto-fix enabled."
271+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "Auto-fix enabled."
251272
fi
252273

253274
# lazy defined functions should be defined now that this is the only script instance.
@@ -258,7 +279,7 @@ function setup_venv() {
258279
local temp_dir
259280
# relax umask to allow mktemp and venv
260281
umask 007
261-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "need venv ..."
282+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "need venv ..."
262283
# Create a temporary directory for the virtual environment
263284
temp_dir=$(mktemp -d)
264285
TEMP_DIRS="${TEMP_DIRS} ${temp_dir}" ;
@@ -300,42 +321,42 @@ function install_package() {
300321
local pkg="$1"
301322
# shellcheck disable=SC2086
302323
if ! python3 -m pip install $PIP_COMMON_FLAGS $PIP_ENV_FLAGS "${pkg}"; then
303-
python3 -B .github/tools/cioutput.py -l warning --file "${req_file}" --title "PIP" "Failed to install ${pkg}" >&2 ;
324+
python3 -B "${CIOUTPUT_PY}" -l warning --file "${req_file}" --title "PIP" "Failed to install ${pkg}" >&2 ;
304325
return 6
305326
fi
306327
return 0
307328
}
308329

309330
# === Utilities ===
310331
function report_summary() {
311-
python3 -B .github/tools/cioutput.py --group "Results" ;
332+
python3 -B "${CIOUTPUT_PY}" --group "Results" ;
312333
# Improved reporting based on EXIT_CODE
313334
case "${EXIT_CODE}" in
314-
0) python3 -B .github/tools/cioutput.py -l info --file "${SCRIPT_FILE}" --title "OK" "OK: Found no detected requirements errors." ;;
315-
1) python3 -B .github/tools/cioutput.py -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "CHECK-PIP" "FAIL: General failure during script execution." >&2 ;;
316-
3) python3 -B .github/tools/cioutput.py -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "CONFIGURATION" "FAIL: Gathering repostory's requirements failed." >&2 ;; # git ls-tree command failed
317-
4) python3 -B .github/tools/cioutput.py -l critical --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "SECURITY" "FAIL: pip-audit detected security vulnerabilities." >&2 ;;
318-
5) python3 -B .github/tools/cioutput.py -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "LICENSE" "FAIL: pip-licenses detected license issues." >&2 ;;
319-
6) python3 -B .github/tools/cioutput.py -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "INSTALL" "FAIL: pip install failed." >&2 ;;
320-
126) python3 -B .github/tools/cioutput.py -l warning --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "SKIPPED" "SKIP: Unable to continue script execution." >&2 ;;
321-
*) python3 -B .github/tools/cioutput.py -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "FAILED" "FAIL: Detected requirements errors." >&2 ;;
335+
0) python3 -B "${CIOUTPUT_PY}" -l info --file "${SCRIPT_FILE}" --title "OK" "OK: Found no detected requirements errors." ;;
336+
1) python3 -B "${CIOUTPUT_PY}" -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "CHECK-PIP" "FAIL: General failure during script execution." >&2 ;;
337+
3) python3 -B "${CIOUTPUT_PY}" -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "CONFIGURATION" "FAIL: Gathering repostory's requirements failed." >&2 ;; # git ls-tree command failed
338+
4) python3 -B "${CIOUTPUT_PY}" -l critical --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "SECURITY" "FAIL: pip-audit detected security vulnerabilities." >&2 ;;
339+
5) python3 -B "${CIOUTPUT_PY}" -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "LICENSE" "FAIL: pip-licenses detected license issues." >&2 ;;
340+
6) python3 -B "${CIOUTPUT_PY}" -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "INSTALL" "FAIL: pip install failed." >&2 ;;
341+
126) python3 -B "${CIOUTPUT_PY}" -l warning --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "SKIPPED" "SKIP: Unable to continue script execution." >&2 ;;
342+
*) python3 -B "${CIOUTPUT_PY}" -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "FAILED" "FAIL: Detected requirements errors." >&2 ;;
322343
esac
323-
python3 -B .github/tools/cioutput.py --group ;
344+
python3 -B "${CIOUTPUT_PY}" --group ;
324345
}
325346

326347
function navigate_dirs_by_git() {
327-
if _TEST_ROOT_DIR=$(git rev-parse --show-superproject-working-tree 2>/dev/null); then
328-
if [ -z "${_TEST_ROOT_DIR}" ]; then
329-
_TEST_ROOT_DIR=$(git rev-parse --show-toplevel 2>/dev/null)
330-
if [ -z "${_TEST_ROOT_DIR}" ]; then
331-
python3 -B .github/tools/cioutput.py -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "${FUNCNAME:-$0}" "FAIL: Could not determine repository root" >&2
348+
if GIT_ROOT_DIR=$(git rev-parse --show-superproject-working-tree 2>/dev/null); then
349+
if [ -z "${GIT_ROOT_DIR}" ]; then
350+
GIT_ROOT_DIR=$(git rev-parse --show-toplevel 2>/dev/null)
351+
if [ -z "${GIT_ROOT_DIR}" ]; then
352+
python3 -B "${CIOUTPUT_PY}" -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "${FUNCNAME:-$0}" "FAIL: Could not determine repository root" >&2
332353
EXIT_CODE=40
333354
return ${EXIT_CODE}
334355
fi
335356
fi
336-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "Found ${_TEST_ROOT_DIR} ..." ;
357+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "Found ${GIT_ROOT_DIR} ..." ;
337358
else
338-
python3 -B .github/tools/cioutput.py -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "${FUNCNAME:-$0}" "FAIL: missing valid repository or source structure" >&2
359+
python3 -B "${CIOUTPUT_PY}" -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "${FUNCNAME:-$0}" "FAIL: missing valid repository or source structure" >&2
339360
EXIT_CODE=40
340361
return ${EXIT_CODE}
341362
fi
@@ -351,23 +372,23 @@ function check_package_licenses() {
351372
# move into a venv
352373
setup_venv ; SUB_CODE=$? ;
353374
wait ;
354-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "venv setup ... (${SUB_CODE})" ;
375+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "venv setup ... (${SUB_CODE})" ;
355376
# Install pip-licenses
356377
install_package "pip-licenses>=5.0" || SUB_CODE=6 ;
357378
wait ;
358379
local pkg
359380
# Install the given Python modules using pip
360381
# shellcheck disable=SC2086
361382
for pkg in ${packages} ; do
362-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "Checking license from package '${pkg}' ..." ;
363-
REQ_SPEC=$(grep -F -- "${pkg}" <(cat <"${_TEST_ROOT_DIR}"/$req_file | sed -E -e '/^[[:space:]]*$/d' | sed -E -e '/^[#]+.*$/d') | grep -m1 -F -- "${pkg}" )
383+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "Checking license from package '${pkg}' ..." ;
384+
REQ_SPEC=$(grep -F -- "${pkg}" <(cat <"${GIT_ROOT_DIR}"/$req_file | sed -E -e '/^[[:space:]]*$/d' | sed -E -e '/^[#]+.*$/d') | grep -m1 -F -- "${pkg}" )
364385
ERR_MSG="pip install '${pkg}' failed for $req_file." ;
365386
if [[ ("${SUB_CODE}" -eq 0) ]] && install_package "${REQ_SPEC};" 2>/dev/null ;
366387
then
367-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "Fetched license from package '${pkg}' ..." ;
388+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "Fetched license from package '${pkg}' ..." ;
368389
else
369390
[[ ("${SUB_CODE}" -eq 0) ]] && SUB_CODE=6 && \
370-
python3 -B .github/tools/cioutput.py -l warning --file "${req_file}" --line 1 --col 1 --title "PIP" "${ERR_MSG}" >&2
391+
python3 -B "${CIOUTPUT_PY}" -l warning --file "${req_file}" --line 1 --col 1 --title "PIP" "${ERR_MSG}" >&2
371392
fi
372393
unset ERR_MSG 2>/dev/null || : ;
373394
done
@@ -380,51 +401,52 @@ function check_package_licenses() {
380401
return "${SUB_CODE}"
381402
}
382403

383-
# THIS IS THE ACTUAL TEST DIR USED (update _TEST_ROOT_DIR as needed)
384-
_TEST_ROOT_DIR=$(git rev-parse --show-toplevel 2>/dev/null) ;
404+
# THIS IS THE ACTUAL TEST DIR USED (update GIT_ROOT_DIR as needed)
405+
GIT_ROOT_DIR=$(git rev-parse --show-toplevel 2>/dev/null) ;
385406
navigate_dirs_by_git
386407

387408
if [[ ("${EXIT_CODE}" -eq 0) ]] ; then
388409

389-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "Reading from repository ${_TEST_ROOT_DIR} ..." ;
410+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "Reading from repository ${GIT_ROOT_DIR} ..." ;
390411
# Get a list of files to check using git ls-tree with filtering (and careful shell globing)
391-
FILES_TO_CHECK=$(git ls-tree -r --full-tree --name-only HEAD -- "${_TEST_ROOT_DIR}"/test/requirements.txt "${_TEST_ROOT_DIR}"/*-requirements.txt "${_TEST_ROOT_DIR}/requirements.txt" 2>/dev/null) || EXIT_CODE=3 ;
392-
[[ ( $EXIT_CODE -eq 0 ) ]] || { python3 -B .github/tools/cioutput.py -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "GIT" "Failed to list requirements files using git ls-tree" >&2 ;}
412+
FILES_TO_CHECK=$(git ls-tree -r --full-tree --name-only HEAD -- "${GIT_ROOT_DIR}"/test/requirements.txt "${GIT_ROOT_DIR}"/*-requirements.txt "${GIT_ROOT_DIR}/requirements.txt" 2>/dev/null) || EXIT_CODE=3 ;
413+
[[ ( $EXIT_CODE -eq 0 ) ]] || { python3 -B "${CIOUTPUT_PY}" -l error --file "${SCRIPT_FILE}" --line ${BASH_LINENO:-0} --title "GIT" "Failed to list requirements files using git ls-tree" >&2 ;}
393414

394415
if [[ ("${EXIT_CODE}" -eq 0) ]] ; then
395416
# THIS IS THE ACTUAL TEST
396-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "Starting checks ..." ;
417+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "Starting checks ..." ;
397418
# Iterate over files and run checks
398419
for req_file in ${FILES_TO_CHECK} ; do
399-
python3 -B .github/tools/cioutput.py --group "Checking ${req_file}" ;
420+
python3 -B "${CIOUTPUT_PY}" --group "Checking ${req_file}" ;
400421
if [[ ( -x $(command -v pip-audit) ) ]] && [[ ("${EXIT_CODE}" -eq 0) ]] ; then
401-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "Auditing ${req_file} for security vulnerabilities ..."
422+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "Auditing ${req_file} for security vulnerabilities ..."
402423
# shellcheck disable=SC2086
403424
{ pip-audit $AUDIT_OPTIONS "${req_file}" || EXIT_CODE=4 ;} ; wait ;
404425
fi ;
405426
if [[ ("${EXIT_CODE}" -eq 0) ]] ; then
406-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "Checking licenses in $req_file ..." ;
427+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "Checking licenses in $req_file ..." ;
407428
# filter for only pkg from requirements file
408429
check_package_licenses "$req_file" ; EXIT_CODE=$?
409430
else
410-
python3 -B .github/tools/cioutput.py -l error --file "${req_file}" --line 1 --title "REQUIREMENTS" "FAIL: Found requirements errors." >&2 ;
431+
python3 -B "${CIOUTPUT_PY}" -l error --file "${req_file}" --line 1 --title "REQUIREMENTS" "FAIL: Found requirements errors." >&2 ;
411432
fi
412-
python3 -B .github/tools/cioutput.py --group ;
433+
python3 -B "${CIOUTPUT_PY}" --group ;
413434
done
414435
fi
415436

416-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "Summary reporting ..." ;
437+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "Summary reporting ..." ;
417438
report_summary
418439
fi
419440

420-
python3 -B .github/tools/cioutput.py --log-level debug -l debug "Cleaning up ..." ;
441+
python3 -B "${CIOUTPUT_PY}" --log-level debug -l debug "Cleaning up ..." ;
421442
cleanup || rm -f "${LOCK_FILE}" 2>/dev/null || : ;
422443

423444
# unset when done
424-
unset _TEST_ROOT_DIR 2>/dev/null || : ;
445+
unset GIT_ROOT_DIR 2>/dev/null || : ;
425446
unset AUDIT_OPTIONS 2>/dev/null || : ;
426447
unset ALLOW_LICENSES 2>/dev/null || : ;
427448
unset LICENSE_OPTIONS 2>/dev/null || : ;
449+
unset CIOUTPUT_PY 2>/dev/null || : ;
428450

429451
wait ;
430452
python3 -B .github/tools/cioutput.py --log-level debug -l debug "Check-pip done." ;

0 commit comments

Comments
 (0)