]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Move artifact upload code into the shell script
authorHugo Landau <hlandau@openssl.org>
Mon, 12 Feb 2024 13:17:01 +0000 (13:17 +0000)
committerHugo Landau <hlandau@openssl.org>
Thu, 21 Mar 2024 17:57:50 +0000 (17:57 +0000)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23551)

.github/workflows/ci.yml
.github/workflows/cross-compiles.yml
.github/workflows/make-test
test/recipes/70-test_quic_multistream.t

index d7df5e8611a33c64b79b3271c30494b1af9974e0..ae784cdb846d2fb779caad2209417ce1a2bb1ebd 100644 (file)
@@ -142,7 +142,7 @@ jobs:
     - name: save artifacts
       uses: actions/upload-artifact@v4
       with:
-        name: "ci@self-hosted"
+        name: "ci@self-hosted-${{ matrix.os }}"
         path: artifacts/
 
   minimal:
index a452b8a46740c98cda2079921a7a4aa3851fde8a..2143b1e9727c6f4c1ffc2004417186b5d6db3d8d 100644 (file)
@@ -221,3 +221,4 @@ jobs:
       with:
         name: "cross-compiles@${{ matrix.platform.arch }}"
         path: artifacts/
+        if-no-files-found: ignore
index f77c7afb01e581cc28fdece5daa8a7e5fe9b7b8c..247b4c61bd46d3359c16b8ba410d1d6d87908c53 100755 (executable)
@@ -3,16 +3,38 @@ set -eo pipefail
 
 cleanup() {
     # Remove if nothing was generated.
-    find artifacts -type d -empty -delete
+    [ -d artifacts ] && find artifacts -type d -empty -delete
 }
 trap cleanup EXIT
 
+# Make a central directory to store all output artifacts of our test run to
+# avoid having to configure multiple upload-artifacts steps in the workflow
+# file.
 OSSL_CI_ARTIFACTS_PATH="artifacts/"
 if [ -n "${GITHUB_RUN_NUMBER}" ]; then
     OSSL_CI_ARTIFACTS_PATH="artifacts/github-${GITHUB_JOB}-${GITHUB_RUN_NUMBER}-${GITHUB_RUN_ID}/"
 fi
 mkdir -p "$OSSL_CI_ARTIFACTS_PATH"
 export OSSL_CI_ARTIFACTS_PATH="$(cd "$OSSL_CI_ARTIFACTS_PATH"; pwd)"
-echo Artifacts path is "$OSSL_CI_ARTIFACTS_PATH"
 
+# Run the tests. This might fail, but we need to capture artifacts anyway.
+set +e
 make test HARNESS_JOBS=${HARNESS_JOBS:-4} "$@"
+RESULT=$?
+set -e
+
+# Move an interesting subset of the test-runs data we want into the artifacts
+# staging directory.
+for test_name in quic_multistream; do
+    if [ -d "test-runs/test_${test_name}" ]; then
+        mv "test-runs/test_${test_name}" "$OSSL_CI_ARTIFACTS_PATH/"
+    fi
+done
+
+# Log the artifact tree.
+echo "::group::List of artifact files generated"
+echo "Test suite exited with $RESULT, artifacts path is $OSSL_CI_ARTIFACTS_PATH"
+(cd "$OSSL_CI_ARTIFACTS_PATH"; find . -type f | sort)
+echo "::endgroup::"
+
+exit $RESULT
index 7257ca09380a7fea060b149aebf594d7c970652e..abaeed8e58e0e3706a8098b7926b5008215c95c8 100644 (file)
@@ -16,10 +16,10 @@ setup("test_quic_multistream");
 plan skip_all => "QUIC protocol is not supported by this OpenSSL build"
     if disabled('quic');
 
-plan tests => 3;
+plan tests => 2;
 
 my $qlog_output;
-if (!disabled('qlog') && $ENV{OSSL_RUN_CI_TESTS} == "1") {
+if (!disabled('qlog')) {
     $qlog_output = result_dir("qlog-output");
     print "# Writing qlog output to $qlog_output\n";
     rmtree($qlog_output, { safe => 1 });
@@ -44,18 +44,3 @@ SKIP: {
                "running qlog verification script");
     };
 }
-
-SKIP: {
-    skip "no qlog", 1 if disabled('qlog');
-    skip "not running CI tests", 1 unless $ENV{OSSL_RUN_CI_TESTS};
-    skip "not running artifacts upload", 1 unless $ENV{OSSL_CI_ARTIFACTS_PATH};
-
-    subtest "copy qlog artifacts to upload directory" => sub {
-        plan tests => 1;
-
-        my $artifacts_path = $ENV{OSSL_CI_ARTIFACTS_PATH};
-        mkpath("${artifacts_path}/quic_multistream_test");
-        ok(run(cmd(["mv", "--", $qlog_output,
-                    "${artifacts_path}/quic_multistream_test/"])));
-    };
-}