From 50e73c6eee8be094ec75920b5b71cdc5984452de Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 7 Aug 2025 14:20:06 +0100 Subject: [PATCH 1/4] ci: Use YAML anchor and aliases for repeated "Checkout" steps --- .github/workflows/ci.yml | 54 ++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5196c53bf..2a4eaa378a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,7 +108,8 @@ jobs: CC: ${{ matrix.cc }} steps: - - name: Checkout + - &checkout + name: Checkout uses: actions/checkout@v4 - name: CI script @@ -145,8 +146,7 @@ jobs: CC: ${{ matrix.cc }} steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script uses: ./.github/actions/run-in-docker-action @@ -177,8 +177,7 @@ jobs: CTIMETESTS: 'no' steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script uses: ./.github/actions/run-in-docker-action @@ -217,8 +216,7 @@ jobs: CTIMETESTS: 'no' steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script env: ${{ matrix.configuration.env_vars }} @@ -258,8 +256,7 @@ jobs: - 'clang-snapshot' steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script uses: ./.github/actions/run-in-docker-action @@ -290,8 +287,7 @@ jobs: CTIMETESTS: 'no' steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script uses: ./.github/actions/run-in-docker-action @@ -352,8 +348,7 @@ jobs: SECP256K1_TEST_ITERS: 2 steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script env: ${{ matrix.env_vars }} @@ -396,8 +391,7 @@ jobs: SYMBOL_CHECK: 'no' steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script env: ${{ matrix.configuration.env_vars }} @@ -447,8 +441,7 @@ jobs: SYMBOL_CHECK: 'no' steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script env: ${{ matrix.configuration.env_vars }} @@ -490,8 +483,7 @@ jobs: HOST: 'i686-w64-mingw32' steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script env: ${{ matrix.configuration.env_vars }} @@ -531,8 +523,7 @@ jobs: - BUILD: 'distcheck' steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: Install Homebrew packages run: | @@ -583,8 +574,7 @@ jobs: - BUILD: 'distcheck' steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: Install Homebrew packages run: | @@ -635,8 +625,7 @@ jobs: cmake_options: '-T ClangCL' steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: Generate buildsystem run: cmake -E env CFLAGS="/WX ${{ matrix.configuration.cpp_flags }}" cmake -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON ${{ matrix.configuration.cmake_options }} @@ -671,8 +660,7 @@ jobs: runs-on: windows-2022 steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: Add cl.exe to PATH uses: ilammy/msvc-dev-cmd@v1 @@ -699,8 +687,7 @@ jobs: ELLSWIFT: 'yes' steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script uses: ./.github/actions/run-in-docker-action @@ -718,8 +705,7 @@ jobs: needs: docker_cache steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script uses: ./.github/actions/run-in-docker-action @@ -738,8 +724,7 @@ jobs: options: --user root steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - name: CI script run: | @@ -750,8 +735,7 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - *checkout - run: ./autogen.sh && ./configure --enable-dev-mode && make distcheck From ef3b5144f5a85c4092f48f6bf7775ebca8adb131 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 7 Aug 2025 14:29:20 +0100 Subject: [PATCH 2/4] ci: Use YAML anchor and aliases for repeated "Print logs" steps --- .github/workflows/ci.yml | 55 ++++++++++------------------------------ 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a4eaa378a..ca3be9f04b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,7 +119,8 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: x64-debian-image - - name: Print logs + - &print-logs + name: Print logs uses: ./.github/actions/print-logs if: ${{ !cancelled() }} @@ -154,9 +155,7 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: x64-debian-image - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} + - *print-logs s390x_debian: name: "s390x (big-endian): Linux (Debian stable, QEMU)" @@ -185,10 +184,7 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: x64-debian-image - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} - + - *print-logs arm32_debian: name: "ARM32: Linux (Debian stable, QEMU)" @@ -225,9 +221,7 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: x64-debian-image - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} + - *print-logs arm64-debian: name: "arm64: Linux (Debian stable)" @@ -264,9 +258,7 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: arm64-debian-image - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} + - *print-logs ppc64le_debian: name: "ppc64le: Linux (Debian stable, QEMU)" @@ -295,10 +287,7 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: x64-debian-image - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} - + - *print-logs valgrind_debian: name: "Valgrind ${{ matrix.binary_arch }} (memcheck)" @@ -357,9 +346,7 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: ${{ matrix.docker_arch }}-debian-image - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} + - *print-logs sanitizers_debian: name: "UBSan, ASan, LSan" @@ -400,9 +387,7 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: x64-debian-image - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} + - *print-logs msan_debian: name: "MSan" @@ -450,10 +435,7 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: x64-debian-image - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} - + - *print-logs mingw_debian: name: ${{ matrix.configuration.job_name }} @@ -492,9 +474,7 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: x64-debian-image - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} + - *print-logs x86_64-macos-native: name: "x86_64: macOS Ventura, Valgrind" @@ -543,9 +523,7 @@ jobs: python3 -m pip install lief python3 ./tools/symbol-check.py .libs/libsecp256k1.dylib - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} + - *print-logs arm64-macos-native: name: "ARM64: macOS Sonoma" @@ -595,10 +573,7 @@ jobs: python3 -m pip install lief python3 ./tools/symbol-check.py .libs/libsecp256k1.dylib - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} - + - *print-logs win64-native: name: ${{ matrix.configuration.job_name }} @@ -695,9 +670,7 @@ jobs: dockerfile: ./ci/linux-debian.Dockerfile tag: x64-debian-image - - name: Print logs - uses: ./.github/actions/print-logs - if: ${{ !cancelled() }} + - *print-logs cxx_headers_debian: name: "C++ (public headers)" From dcaf102fbce230b0dfe78f30810a26f4fa52b537 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 7 Aug 2025 15:37:08 +0100 Subject: [PATCH 3/4] ci, refactor: Generalize use of `matrix.configuration.env_vars` --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca3be9f04b..b2302de1f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,6 +132,8 @@ jobs: strategy: fail-fast: false matrix: + configuration: + - env_vars: {} cc: - 'i686-linux-gnu-gcc' - 'clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include' @@ -150,6 +152,7 @@ jobs: - *checkout - name: CI script + env: ${{ matrix.configuration.env_vars }} uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile @@ -162,6 +165,11 @@ jobs: runs-on: ubuntu-latest needs: docker_cache + strategy: + matrix: + configuration: + - env_vars: {} + env: WRAPPER_CMD: 'qemu-s390x' SECP256K1_TEST_ITERS: 16 @@ -179,6 +187,7 @@ jobs: - *checkout - name: CI script + env: ${{ matrix.configuration.env_vars }} uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile @@ -265,6 +274,11 @@ jobs: runs-on: ubuntu-latest needs: docker_cache + strategy: + matrix: + configuration: + - env_vars: {} + env: WRAPPER_CMD: 'qemu-ppc64le' SECP256K1_TEST_ITERS: 16 @@ -282,6 +296,7 @@ jobs: - *checkout - name: CI script + env: ${{ matrix.configuration.env_vars }} uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile @@ -649,6 +664,11 @@ jobs: runs-on: ubuntu-latest needs: docker_cache + strategy: + matrix: + configuration: + - env_vars: {} + env: CC: 'g++' CFLAGS: '-fpermissive -g' @@ -665,6 +685,7 @@ jobs: - *checkout - name: CI script + env: ${{ matrix.configuration.env_vars }} uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile From 8729f4e190a151576c035b709eff686b1b54eda2 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 7 Aug 2025 15:30:29 +0100 Subject: [PATCH 4/4] ci: Use YAML anchor and aliases for repeated "CI script" steps --- .github/workflows/ci.yml | 75 ++++++---------------------------------- 1 file changed, 10 insertions(+), 65 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2302de1f0..f92189cb1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,8 @@ jobs: name: Checkout uses: actions/checkout@v4 - - name: CI script + - &x64_ci_script + name: CI script env: ${{ matrix.configuration.env_vars }} uses: ./.github/actions/run-in-docker-action with: @@ -150,14 +151,7 @@ jobs: steps: - *checkout - - - name: CI script - env: ${{ matrix.configuration.env_vars }} - uses: ./.github/actions/run-in-docker-action - with: - dockerfile: ./ci/linux-debian.Dockerfile - tag: x64-debian-image - + - *x64_ci_script - *print-logs s390x_debian: @@ -185,14 +179,7 @@ jobs: steps: - *checkout - - - name: CI script - env: ${{ matrix.configuration.env_vars }} - uses: ./.github/actions/run-in-docker-action - with: - dockerfile: ./ci/linux-debian.Dockerfile - tag: x64-debian-image - + - *x64_ci_script - *print-logs arm32_debian: @@ -222,14 +209,7 @@ jobs: steps: - *checkout - - - name: CI script - env: ${{ matrix.configuration.env_vars }} - uses: ./.github/actions/run-in-docker-action - with: - dockerfile: ./ci/linux-debian.Dockerfile - tag: x64-debian-image - + - *x64_ci_script - *print-logs arm64-debian: @@ -294,14 +274,7 @@ jobs: steps: - *checkout - - - name: CI script - env: ${{ matrix.configuration.env_vars }} - uses: ./.github/actions/run-in-docker-action - with: - dockerfile: ./ci/linux-debian.Dockerfile - tag: x64-debian-image - + - *x64_ci_script - *print-logs valgrind_debian: @@ -394,14 +367,7 @@ jobs: steps: - *checkout - - - name: CI script - env: ${{ matrix.configuration.env_vars }} - uses: ./.github/actions/run-in-docker-action - with: - dockerfile: ./ci/linux-debian.Dockerfile - tag: x64-debian-image - + - *x64_ci_script - *print-logs msan_debian: @@ -442,14 +408,7 @@ jobs: steps: - *checkout - - - name: CI script - env: ${{ matrix.configuration.env_vars }} - uses: ./.github/actions/run-in-docker-action - with: - dockerfile: ./ci/linux-debian.Dockerfile - tag: x64-debian-image - + - *x64_ci_script - *print-logs mingw_debian: @@ -481,14 +440,7 @@ jobs: steps: - *checkout - - - name: CI script - env: ${{ matrix.configuration.env_vars }} - uses: ./.github/actions/run-in-docker-action - with: - dockerfile: ./ci/linux-debian.Dockerfile - tag: x64-debian-image - + - *x64_ci_script - *print-logs x86_64-macos-native: @@ -683,14 +635,7 @@ jobs: steps: - *checkout - - - name: CI script - env: ${{ matrix.configuration.env_vars }} - uses: ./.github/actions/run-in-docker-action - with: - dockerfile: ./ci/linux-debian.Dockerfile - tag: x64-debian-image - + - *x64_ci_script - *print-logs cxx_headers_debian: