1
0
mirror of https://github.com/uutils/coreutils synced 2024-07-09 04:06:02 +00:00

maint/CICD ~ (GnuTests) support local bespoke repo default branch

This commit is contained in:
Roy Ivy III 2022-03-31 23:38:46 +02:00 committed by Sylvestre Ledru
parent 8518fff0fd
commit bed7dc5a29
2 changed files with 5 additions and 2 deletions

View File

@ -167,6 +167,7 @@ jobs:
have_new_failures=""
REF_LOG_FILE='${{ steps.vars.outputs.path_reference }}/test-logs/test-suite.log'
REF_SUMMARY_FILE='${{ steps.vars.outputs.path_reference }}/test-summary/gnu-result.json'
REPO_DEFAULT_BRANCH='${{ steps.vars.outputs.repo_default_branch }}'
if test -f "${REF_LOG_FILE}"; then
echo "Reference SHA1/ID: $(sha1sum -- "${REF_SUMMARY_FILE}")"
REF_FAILING=$(sed -n "s/^FAIL: \([[:print:]]\+\).*/\1/p" "${REF_LOG_FILE}" | sort)

View File

@ -9,6 +9,8 @@ import json
import sys
from os import environ
REPO_DEFAULT_BRANCH = environ.get('REPO_DEFAULT_BRANCH', 'main')
NEW = json.load(open("gnu-result.json"))
OLD = json.load(open("main-gnu-result.json"))
@ -24,12 +26,12 @@ skip_d = int(current["skip"]) - int(last["skip"])
# Get an annotation to highlight changes
print(
f"::warning ::Changes from main: PASS {pass_d:+d} / FAIL {fail_d:+d} / ERROR {error_d:+d} / SKIP {skip_d:+d} "
f"::warning ::Changes from '{REPO_DEFAULT_BRANCH}': PASS {pass_d:+d} / FAIL {fail_d:+d} / ERROR {error_d:+d} / SKIP {skip_d:+d} "
)
# If results are worse fail the job to draw attention
if pass_d < 0:
print(
f"::error ::PASS count is reduced from main: PASS {pass_d:+d} "
f"::error ::PASS count is reduced from '{REPO_DEFAULT_BRANCH}': PASS {pass_d:+d} "
)
sys.exit(1)