Merge bitcoin-core/secp256k1#1655: gha: Print all *.log files, in a separate action

59860bcc24 gha: Print all *.log files, in a separate action (Tim Ruffing)

Pull request description:

  Before this commit, we didn't print *_example.log files and
  test_suite.log.

  Printing is now handled in a separate action, which avoids code
  duplication and makes the ci.yml file more readable. This changes the
  folding/grouping of the log output in the GitHub Actions CI, but I
  think the new variant is as good as the old one.

  Furthermore, the condition for printing the logs is changed from
  "always()" to "!cancelled()". This ensures that logs will still be
  printed if previous steps such as the CI script failed, but that they
  won't be printed if the entire run is cancelled (e.g., by clicking a
  button in the UI or through a force-push to the PR). This is in line
  with a recommendation in the GHA docs:
  https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#always

ACKs for top commit:
  hebasto:
    ACK 59860bcc24.
  sipa:
    ACK 59860bcc24

Tree-SHA512: ca11f5e5f01660964276b9c2e11c22caeed8492e9c7ffaa2078aaaa733005c63242fc93a1056124fb8f1f83019d46818c12b10142fb10f43270a8562fd10885a
This commit is contained in:
merge-script
2025-03-11 22:08:45 +01:00
2 changed files with 77 additions and 221 deletions

34
.github/actions/print-logs/action.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: "Print logs"
description: "Print the log files produced by ci/ci.sh"
runs:
using: "composite"
steps:
- shell: bash
run: |
# Print the log files produced by ci/ci.sh
# Helper functions
group() {
title=$1
echo "::group::$title"
}
endgroup() {
echo "::endgroup::"
}
cat_file() {
file=$1
group "$file"
cat "$file"
endgroup
}
# Print all *.log files
shopt -s nullglob
for file in *.log; do
cat_file "$file"
done
# Print environment
group "CI env"
env
endgroup

View File

@@ -107,23 +107,9 @@ jobs:
dockerfile: ./ci/linux-debian.Dockerfile dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image tag: linux-debian-image
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
i686_debian: i686_debian:
name: "i686: Linux (Debian stable)" name: "i686: Linux (Debian stable)"
@@ -157,23 +143,9 @@ jobs:
dockerfile: ./ci/linux-debian.Dockerfile dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image tag: linux-debian-image
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
s390x_debian: s390x_debian:
name: "s390x (big-endian): Linux (Debian stable, QEMU)" name: "s390x (big-endian): Linux (Debian stable, QEMU)"
@@ -203,23 +175,10 @@ jobs:
dockerfile: ./ci/linux-debian.Dockerfile dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image tag: linux-debian-image
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
arm32_debian: arm32_debian:
name: "ARM32: Linux (Debian stable, QEMU)" name: "ARM32: Linux (Debian stable, QEMU)"
@@ -257,23 +216,9 @@ jobs:
dockerfile: ./ci/linux-debian.Dockerfile dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image tag: linux-debian-image
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
arm64_debian: arm64_debian:
name: "ARM64: Linux (Debian stable, QEMU)" name: "ARM64: Linux (Debian stable, QEMU)"
@@ -314,23 +259,9 @@ jobs:
dockerfile: ./ci/linux-debian.Dockerfile dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image tag: linux-debian-image
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
ppc64le_debian: ppc64le_debian:
name: "ppc64le: Linux (Debian stable, QEMU)" name: "ppc64le: Linux (Debian stable, QEMU)"
@@ -360,23 +291,10 @@ jobs:
dockerfile: ./ci/linux-debian.Dockerfile dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image tag: linux-debian-image
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
valgrind_debian: valgrind_debian:
name: "Valgrind (memcheck)" name: "Valgrind (memcheck)"
@@ -416,23 +334,9 @@ jobs:
dockerfile: ./ci/linux-debian.Dockerfile dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image tag: linux-debian-image
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
sanitizers_debian: sanitizers_debian:
name: "UBSan, ASan, LSan" name: "UBSan, ASan, LSan"
@@ -473,23 +377,9 @@ jobs:
dockerfile: ./ci/linux-debian.Dockerfile dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image tag: linux-debian-image
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
msan_debian: msan_debian:
name: "MSan" name: "MSan"
@@ -537,23 +427,10 @@ jobs:
dockerfile: ./ci/linux-debian.Dockerfile dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image tag: linux-debian-image
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
mingw_debian: mingw_debian:
name: ${{ matrix.configuration.job_name }} name: ${{ matrix.configuration.job_name }}
@@ -593,23 +470,9 @@ jobs:
dockerfile: ./ci/linux-debian.Dockerfile dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image tag: linux-debian-image
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
x86_64-macos-native: x86_64-macos-native:
name: "x86_64: macOS Ventura, Valgrind" name: "x86_64: macOS Ventura, Valgrind"
@@ -652,23 +515,9 @@ jobs:
env: ${{ matrix.env_vars }} env: ${{ matrix.env_vars }}
run: ./ci/ci.sh run: ./ci/ci.sh
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
arm64-macos-native: arm64-macos-native:
name: "ARM64: macOS Sonoma" name: "ARM64: macOS Sonoma"
@@ -708,23 +557,10 @@ jobs:
env: ${{ matrix.env_vars }} env: ${{ matrix.env_vars }}
run: ./ci/ci.sh run: ./ci/ci.sh
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
win64-native: win64-native:
name: ${{ matrix.configuration.job_name }} name: ${{ matrix.configuration.job_name }}
@@ -815,23 +651,9 @@ jobs:
dockerfile: ./ci/linux-debian.Dockerfile dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image tag: linux-debian-image
- run: cat tests.log || true - name: Print logs
if: ${{ always() }} uses: ./.github/actions/print-logs
- run: cat noverify_tests.log || true if: ${{ !cancelled() }}
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}
cxx_headers_debian: cxx_headers_debian:
name: "C++ (public headers)" name: "C++ (public headers)"