This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/main by this push:
     new acd123f3a1 Upload reproducibility failure context artifacts in CI 
(#1321)
acd123f3a1 is described below

commit acd123f3a1902890057a85faa307b4dfedd570bc
Author: Josh Soref <[email protected]>
AuthorDate: Fri Mar 3 10:38:56 2023 -0500

    Upload reproducibility failure context artifacts in CI (#1321)
    
    Co-authored-by: Volkan Yazıcı <[email protected]>
---
 .github/workflows/build.yml | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f3d83d21cc..8961979846 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -67,24 +67,34 @@ jobs:
       # `clean verify artifact:compare` is required to generate the build 
reproducibility report.
       # For details, see: 
https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
       - name: Report build reproducibility
+        id: report-reproducible
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -DskipTests=true \
-            clean verify artifact:compare
-
-      - name: Verify build reproducibility
-        shell: bash
-        run: |
+            clean verify artifact:compare || failed=1
           for report_file in target/*.buildcompare **/target/*.buildcompare; do
             if ! grep -q "^ko=0$" "$report_file"; then
               echo "Spotted build reproducibility failure in \`$report_file\`:"
               cat "$report_file"
-              exit 1
+              failed=1
             fi
           done
+          if [ -n "$failed" ]; then
+            exit $failed
+          fi
+
+      - name: Upload reproducibility failure context artifacts
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
+        with:
+          name: reproducubility-failure-context-${{matrix.os}}
+          path: |
+            **/target/*.buildcompare
+            **/target/*.jar
+            **/target/reference/*.jar
 
       - name: Maven "verify"
         timeout-minutes: 60

Reply via email to