[RFC PATCH v5 04/10] CI: stop setting FAILED_TEST_ARTIFACTS N times
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Apr 21, 2022, 18:36 UTC
- Message-ID
- <RFC-patch-v5-04.10-1482f840f64-20220421T183001Z-avarab@gmail.com>
- In-Reply-To
- <RFC-cover-v5-00.10-00000000000-20220421T183001Z-avarab@gmail.com>
The FAILED_TEST_ARTIFACTS variable introduced in f72f328bc57 (ci: let GitHub Actions upload failed tests' directories, 2020-04-11) is only used once in the main.yml, there is no need to set it N times if we have N failing tests.
See also 92bf1b60673 (ci: avoid `set-env` construct in print-test-failures.sh, 2020-11-17) which moved it to using $GITHUB_ENV, we'll now check if it's set like ci/lib.sh, this makes it easier to test this script locally.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- ci/print-test-failures.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh index 23324021f13..27df5081f8b 100755 --- a/ci/print-test-failures.sh +++ b/ci/print-test-failures.sh @@ -49,7 +49,6 @@ do case "$CI_TYPE" in github-actions) mkdir -p t/failed-test-artifacts - echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV cp "t/test-results/${TEST_OUT}" t/failed-test-artifacts/ ( cd t && @@ -62,6 +61,11 @@ done if test -n "$failed" then + if test -n "$GITHUB_ENV" + then + echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV + fi + if test -n "$exit_code" then exit 1
-- 2.36.0.879.g3659959fcca