ci: DRY workflow using anchors #1719

pull hebasto wants to merge 6 commits into bitcoin-core:master from hebasto:250807-yaml-anchors changing 2 files +73 −152
  1. hebasto commented at 2:52 pm on August 7, 2025: member

    GHA YAML parser now supports anchors.

    This PR makes use of that support to DRY the workflow code.

  2. hebasto force-pushed on Aug 7, 2025
  3. real-or-random added the label ci on Aug 7, 2025
  4. real-or-random added the label tweak/refactor on Aug 7, 2025
  5. real-or-random commented at 4:25 pm on August 7, 2025: contributor

    Concept ACK

    These files will always be a bit of a mess but this is already much better.

  6. real-or-random requested review from Copilot on Aug 11, 2025
  7. in .github/workflows/ci.yml:136 in 8729f4e190 outdated
    132@@ -130,6 +133,8 @@ jobs:
    133     strategy:
    134       fail-fast: false
    135       matrix:
    136+        configuration:
    137+          - env_vars: {}
    


    Copilot commented at 12:14 pm on August 11, 2025:

    Adding an empty matrix configuration with just ’env_vars: {}’ appears to serve no functional purpose for the i686_debian job. This adds unnecessary complexity without providing the matrix benefits that other jobs use.

  8. in .github/workflows/ci.yml:165 in 8729f4e190 outdated
    173 
    174+    strategy:
    175+      matrix:
    176+        configuration:
    177+          - env_vars: {}
    178+
    


    Copilot commented at 12:14 pm on August 11, 2025:

    Adding an empty matrix configuration with just ’env_vars: {}’ appears to serve no functional purpose for the s390x_debian job. This adds unnecessary complexity without providing the matrix benefits that other jobs use.

  9. Copilot commented at 12:14 pm on August 11, 2025: none

    Pull Request Overview

    This PR introduces YAML anchors to reduce code duplication in the GitHub Actions CI workflow. The changes leverage GitHub Actions’ newly added support for YAML anchors to implement the DRY (Don’t Repeat Yourself) principle across multiple CI jobs.

    • Defines reusable step anchors for common operations (checkout, CI script execution, log printing)
    • Replaces duplicated step definitions with anchor references across multiple jobs
    • Adds matrix configurations to jobs that previously lacked them for consistency
  10. in .github/workflows/ci.yml:256 in 8729f4e190 outdated
    261 
    262+    strategy:
    263+      matrix:
    264+        configuration:
    265+          - env_vars: {}
    266+
    


    Copilot commented at 12:14 pm on August 11, 2025:

    Adding an empty matrix configuration with just ’env_vars: {}’ appears to serve no functional purpose for the ppc64le_debian job. This adds unnecessary complexity without providing the matrix benefits that other jobs use.

  11. in .github/workflows/ci.yml:612 in 8729f4e190 outdated
    615@@ -686,6 +616,11 @@ jobs:
    616     runs-on: ubuntu-latest
    617     needs: docker_cache
    618 
    619+    strategy:
    620+      matrix:
    621+        configuration:
    622+          - env_vars: {}
    623+
    


    Copilot commented at 12:14 pm on August 11, 2025:

    Adding an empty matrix configuration with just ’env_vars: {}’ appears to serve no functional purpose for the cpp_gcc_debian job. This adds unnecessary complexity without providing the matrix benefits that other jobs use.

  12. real-or-random approved
  13. real-or-random commented at 7:57 am on August 12, 2025: contributor
    utACK 8729f4e190a151576c035b709eff686b1b54eda2
  14. kmk142789 approved
  15. real-or-random commented at 8:56 am on October 14, 2025: contributor
    needs rebase
  16. ci: Use YAML anchor and aliases for repeated "Checkout" steps 574c2f3080
  17. ci: Bump `actions/checkout` version
    See https://github.com/actions/checkout/releases.
    a889cd93df
  18. ci: Use YAML anchor and aliases for repeated "Print logs" steps 4b644da199
  19. hebasto force-pushed on Oct 14, 2025
  20. ci, refactor: Generalize use of `matrix.configuration.env_vars` dff1bc107d
  21. ci: Use YAML anchor and aliases for repeated "CI script" steps 1decc49a1f
  22. ci: Drop default for `inputs.command` in `run-in-docker-action`
    This change decreases coupling.
    15d014804e
  23. hebasto force-pushed on Oct 14, 2025
  24. hebasto commented at 11:35 am on October 14, 2025: member

    needs rebase

    Rebased.

    Additionally, the following changes have been made:

    1. Updated anchor names to use the ALL_CAPS style, matching Bitcoin Core.
    2. Added commit “ci: Bump actions/checkout version”.
    3. Added commit “ci: Drop default for inputs.command in run-in-docker-action”. See: #1756 (review).
  25. real-or-random approved
  26. real-or-random commented at 7:18 pm on October 14, 2025: contributor
    utACK 15d014804e5927b0f9dd8ed4fdc0be2a45f74e24
  27. real-or-random merged this on Oct 14, 2025
  28. real-or-random closed this on Oct 14, 2025

  29. hebasto deleted the branch on Oct 14, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-11-04 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me