csecp256k1

Haskell FFI bindings to bitcoin-core/secp256k1 (docs.ppad.tech/csecp256k1).
git clone git://git.ppad.tech/csecp256k1.git
Log | Files | Refs | README | LICENSE

ci.yml (24765B)


      1 name: CI
      2 on:
      3   pull_request:
      4   push:
      5     branches:
      6       - '**'
      7     tags-ignore:
      8       - '**'
      9 
     10 concurrency:
     11   group: ${{ github.event_name != 'pull_request' && github.run_id || github.ref }}
     12   cancel-in-progress: true
     13 
     14 env:
     15   ### compiler options
     16   HOST:
     17   WRAPPER_CMD:
     18   # Specific warnings can be disabled with -Wno-error=foo.
     19   # -pedantic-errors is not equivalent to -Werror=pedantic and thus not implied by -Werror according to the GCC manual.
     20   WERROR_CFLAGS: '-Werror -pedantic-errors'
     21   MAKEFLAGS: '-j4'
     22   BUILD: 'check'
     23   ### secp256k1 config
     24   ECMULTWINDOW: 'auto'
     25   ECMULTGENPRECISION: 'auto'
     26   ASM: 'no'
     27   WIDEMUL: 'auto'
     28   WITH_VALGRIND: 'yes'
     29   EXTRAFLAGS:
     30   ### secp256k1 modules
     31   EXPERIMENTAL: 'no'
     32   ECDH: 'no'
     33   RECOVERY: 'no'
     34   SCHNORRSIG: 'no'
     35   ELLSWIFT: 'no'
     36   ### test options
     37   SECP256K1_TEST_ITERS:
     38   BENCH: 'yes'
     39   SECP256K1_BENCH_ITERS: 2
     40   CTIMETESTS: 'yes'
     41   # Compile and run the examples.
     42   EXAMPLES: 'yes'
     43 
     44 jobs:
     45   docker_cache:
     46     name: "Build Docker image"
     47     runs-on: ubuntu-latest
     48     steps:
     49       - name: Set up Docker Buildx
     50         uses: docker/setup-buildx-action@v3
     51         with:
     52           # See: https://github.com/moby/buildkit/issues/3969.
     53           driver-opts: |
     54             network=host
     55 
     56       - name: Build container
     57         uses: docker/build-push-action@v5
     58         with:
     59           file: ./ci/linux-debian.Dockerfile
     60           tags: linux-debian-image
     61           cache-from: type=gha
     62           cache-to: type=gha,mode=min
     63 
     64   linux_debian:
     65     name: "x86_64: Linux (Debian stable)"
     66     runs-on: ubuntu-latest
     67     needs: docker_cache
     68 
     69     strategy:
     70       fail-fast: false
     71       matrix:
     72         configuration:
     73           - env_vars: { WIDEMUL: 'int64',  RECOVERY: 'yes' }
     74           - env_vars: { WIDEMUL: 'int64',                   ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
     75           - env_vars: { WIDEMUL: 'int128' }
     76           - env_vars: { WIDEMUL: 'int128_struct',                                           ELLSWIFT: 'yes' }
     77           - env_vars: { WIDEMUL: 'int128', RECOVERY: 'yes',              SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
     78           - env_vars: { WIDEMUL: 'int128',                  ECDH: 'yes', SCHNORRSIG: 'yes' }
     79           - env_vars: { WIDEMUL: 'int128', ASM: 'x86_64',                                   ELLSWIFT: 'yes' }
     80           - env_vars: {                    RECOVERY: 'yes',              SCHNORRSIG: 'yes' }
     81           - env_vars: { CTIMETESTS: 'no',  RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', CPPFLAGS: '-DVERIFY' }
     82           - env_vars: { BUILD: 'distcheck', WITH_VALGRIND: 'no', CTIMETESTS: 'no', BENCH: 'no' }
     83           - env_vars: { CPPFLAGS: '-DDETERMINISTIC' }
     84           - env_vars: { CFLAGS: '-O0', CTIMETESTS: 'no' }
     85           - env_vars: { CFLAGS: '-O1',     RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
     86           - env_vars: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
     87           - env_vars: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
     88         cc:
     89           - 'gcc'
     90           - 'clang'
     91           - 'gcc-snapshot'
     92           - 'clang-snapshot'
     93 
     94     env:
     95       CC: ${{ matrix.cc }}
     96 
     97     steps:
     98       - name: Checkout
     99         uses: actions/checkout@v4
    100 
    101       - name: CI script
    102         env: ${{ matrix.configuration.env_vars }}
    103         uses: ./.github/actions/run-in-docker-action
    104         with:
    105           dockerfile: ./ci/linux-debian.Dockerfile
    106           tag: linux-debian-image
    107 
    108       - run: cat tests.log || true
    109         if: ${{ always() }}
    110       - run: cat noverify_tests.log || true
    111         if: ${{ always() }}
    112       - run: cat exhaustive_tests.log || true
    113         if: ${{ always() }}
    114       - run: cat ctime_tests.log || true
    115         if: ${{ always() }}
    116       - run: cat bench.log || true
    117         if: ${{ always() }}
    118       - run: cat config.log || true
    119         if: ${{ always() }}
    120       - run: cat test_env.log || true
    121         if: ${{ always() }}
    122       - name: CI env
    123         run: env
    124         if: ${{ always() }}
    125 
    126   i686_debian:
    127     name: "i686: Linux (Debian stable)"
    128     runs-on: ubuntu-latest
    129     needs: docker_cache
    130 
    131     strategy:
    132       fail-fast: false
    133       matrix:
    134         cc:
    135           - 'i686-linux-gnu-gcc'
    136           - 'clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include'
    137 
    138     env:
    139       HOST: 'i686-linux-gnu'
    140       ECDH: 'yes'
    141       RECOVERY: 'yes'
    142       SCHNORRSIG: 'yes'
    143       ELLSWIFT: 'yes'
    144       CC: ${{ matrix.cc }}
    145 
    146     steps:
    147       - name: Checkout
    148         uses: actions/checkout@v4
    149 
    150       - name: CI script
    151         uses: ./.github/actions/run-in-docker-action
    152         with:
    153           dockerfile: ./ci/linux-debian.Dockerfile
    154           tag: linux-debian-image
    155 
    156       - run: cat tests.log || true
    157         if: ${{ always() }}
    158       - run: cat noverify_tests.log || true
    159         if: ${{ always() }}
    160       - run: cat exhaustive_tests.log || true
    161         if: ${{ always() }}
    162       - run: cat ctime_tests.log || true
    163         if: ${{ always() }}
    164       - run: cat bench.log || true
    165         if: ${{ always() }}
    166       - run: cat config.log || true
    167         if: ${{ always() }}
    168       - run: cat test_env.log || true
    169         if: ${{ always() }}
    170       - name: CI env
    171         run: env
    172         if: ${{ always() }}
    173 
    174   s390x_debian:
    175     name: "s390x (big-endian): Linux (Debian stable, QEMU)"
    176     runs-on: ubuntu-latest
    177     needs: docker_cache
    178 
    179     env:
    180       WRAPPER_CMD: 'qemu-s390x'
    181       SECP256K1_TEST_ITERS: 16
    182       HOST: 's390x-linux-gnu'
    183       WITH_VALGRIND: 'no'
    184       ECDH: 'yes'
    185       RECOVERY: 'yes'
    186       SCHNORRSIG: 'yes'
    187       ELLSWIFT: 'yes'
    188       CTIMETESTS: 'no'
    189 
    190     steps:
    191       - name: Checkout
    192         uses: actions/checkout@v4
    193 
    194       - name: CI script
    195         uses: ./.github/actions/run-in-docker-action
    196         with:
    197           dockerfile: ./ci/linux-debian.Dockerfile
    198           tag: linux-debian-image
    199 
    200       - run: cat tests.log || true
    201         if: ${{ always() }}
    202       - run: cat noverify_tests.log || true
    203         if: ${{ always() }}
    204       - run: cat exhaustive_tests.log || true
    205         if: ${{ always() }}
    206       - run: cat ctime_tests.log || true
    207         if: ${{ always() }}
    208       - run: cat bench.log || true
    209         if: ${{ always() }}
    210       - run: cat config.log || true
    211         if: ${{ always() }}
    212       - run: cat test_env.log || true
    213         if: ${{ always() }}
    214       - name: CI env
    215         run: env
    216         if: ${{ always() }}
    217 
    218   arm32_debian:
    219     name: "ARM32: Linux (Debian stable, QEMU)"
    220     runs-on: ubuntu-latest
    221     needs: docker_cache
    222 
    223     strategy:
    224       fail-fast: false
    225       matrix:
    226         configuration:
    227           - env_vars: {}
    228           - env_vars: { EXPERIMENTAL: 'yes', ASM: 'arm32' }
    229 
    230     env:
    231       WRAPPER_CMD: 'qemu-arm'
    232       SECP256K1_TEST_ITERS: 16
    233       HOST: 'arm-linux-gnueabihf'
    234       WITH_VALGRIND: 'no'
    235       ECDH: 'yes'
    236       RECOVERY: 'yes'
    237       SCHNORRSIG: 'yes'
    238       ELLSWIFT: 'yes'
    239       CTIMETESTS: 'no'
    240 
    241     steps:
    242       - name: Checkout
    243         uses: actions/checkout@v4
    244 
    245       - name: CI script
    246         env: ${{ matrix.configuration.env_vars }}
    247         uses: ./.github/actions/run-in-docker-action
    248         with:
    249           dockerfile: ./ci/linux-debian.Dockerfile
    250           tag: linux-debian-image
    251 
    252       - run: cat tests.log || true
    253         if: ${{ always() }}
    254       - run: cat noverify_tests.log || true
    255         if: ${{ always() }}
    256       - run: cat exhaustive_tests.log || true
    257         if: ${{ always() }}
    258       - run: cat ctime_tests.log || true
    259         if: ${{ always() }}
    260       - run: cat bench.log || true
    261         if: ${{ always() }}
    262       - run: cat config.log || true
    263         if: ${{ always() }}
    264       - run: cat test_env.log || true
    265         if: ${{ always() }}
    266       - name: CI env
    267         run: env
    268         if: ${{ always() }}
    269 
    270   arm64_debian:
    271     name: "ARM64: Linux (Debian stable, QEMU)"
    272     runs-on: ubuntu-latest
    273     needs: docker_cache
    274 
    275     env:
    276       WRAPPER_CMD: 'qemu-aarch64'
    277       SECP256K1_TEST_ITERS: 16
    278       HOST: 'aarch64-linux-gnu'
    279       WITH_VALGRIND: 'no'
    280       ECDH: 'yes'
    281       RECOVERY: 'yes'
    282       SCHNORRSIG: 'yes'
    283       ELLSWIFT: 'yes'
    284       CTIMETESTS: 'no'
    285 
    286     strategy:
    287       fail-fast: false
    288       matrix:
    289         configuration:
    290           - env_vars: { } # gcc
    291           - env_vars: # clang
    292               CC: 'clang --target=aarch64-linux-gnu'
    293           - env_vars: # clang-snapshot
    294               CC: 'clang-snapshot --target=aarch64-linux-gnu'
    295 
    296     steps:
    297       - name: Checkout
    298         uses: actions/checkout@v4
    299 
    300       - name: CI script
    301         env: ${{ matrix.configuration.env_vars }}
    302         uses: ./.github/actions/run-in-docker-action
    303         with:
    304           dockerfile: ./ci/linux-debian.Dockerfile
    305           tag: linux-debian-image
    306 
    307       - run: cat tests.log || true
    308         if: ${{ always() }}
    309       - run: cat noverify_tests.log || true
    310         if: ${{ always() }}
    311       - run: cat exhaustive_tests.log || true
    312         if: ${{ always() }}
    313       - run: cat ctime_tests.log || true
    314         if: ${{ always() }}
    315       - run: cat bench.log || true
    316         if: ${{ always() }}
    317       - run: cat config.log || true
    318         if: ${{ always() }}
    319       - run: cat test_env.log || true
    320         if: ${{ always() }}
    321       - name: CI env
    322         run: env
    323         if: ${{ always() }}
    324 
    325   ppc64le_debian:
    326     name: "ppc64le: Linux (Debian stable, QEMU)"
    327     runs-on: ubuntu-latest
    328     needs: docker_cache
    329 
    330     env:
    331       WRAPPER_CMD: 'qemu-ppc64le'
    332       SECP256K1_TEST_ITERS: 16
    333       HOST: 'powerpc64le-linux-gnu'
    334       WITH_VALGRIND: 'no'
    335       ECDH: 'yes'
    336       RECOVERY: 'yes'
    337       SCHNORRSIG: 'yes'
    338       ELLSWIFT: 'yes'
    339       CTIMETESTS: 'no'
    340 
    341     steps:
    342       - name: Checkout
    343         uses: actions/checkout@v4
    344 
    345       - name: CI script
    346         uses: ./.github/actions/run-in-docker-action
    347         with:
    348           dockerfile: ./ci/linux-debian.Dockerfile
    349           tag: linux-debian-image
    350 
    351       - run: cat tests.log || true
    352         if: ${{ always() }}
    353       - run: cat noverify_tests.log || true
    354         if: ${{ always() }}
    355       - run: cat exhaustive_tests.log || true
    356         if: ${{ always() }}
    357       - run: cat ctime_tests.log || true
    358         if: ${{ always() }}
    359       - run: cat bench.log || true
    360         if: ${{ always() }}
    361       - run: cat config.log || true
    362         if: ${{ always() }}
    363       - run: cat test_env.log || true
    364         if: ${{ always() }}
    365       - name: CI env
    366         run: env
    367         if: ${{ always() }}
    368 
    369   valgrind_debian:
    370     name: "Valgrind (memcheck)"
    371     runs-on: ubuntu-latest
    372     needs: docker_cache
    373 
    374     strategy:
    375       fail-fast: false
    376       matrix:
    377         configuration:
    378           - env_vars: { CC: 'clang',                                      ASM: 'auto' }
    379           - env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'auto' }
    380           - env_vars: { CC: 'clang',                                      ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
    381           - env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
    382 
    383     env:
    384       # The `--error-exitcode` is required to make the test fail if valgrind found errors,
    385       # otherwise it will return 0 (https://www.valgrind.org/docs/manual/manual-core.html).
    386       WRAPPER_CMD: 'valgrind --error-exitcode=42'
    387       ECDH: 'yes'
    388       RECOVERY: 'yes'
    389       SCHNORRSIG: 'yes'
    390       ELLSWIFT: 'yes'
    391       CTIMETESTS: 'no'
    392       SECP256K1_TEST_ITERS: 2
    393 
    394     steps:
    395       - name: Checkout
    396         uses: actions/checkout@v4
    397 
    398       - name: CI script
    399         env: ${{ matrix.configuration.env_vars }}
    400         uses: ./.github/actions/run-in-docker-action
    401         with:
    402           dockerfile: ./ci/linux-debian.Dockerfile
    403           tag: linux-debian-image
    404 
    405       - run: cat tests.log || true
    406         if: ${{ always() }}
    407       - run: cat noverify_tests.log || true
    408         if: ${{ always() }}
    409       - run: cat exhaustive_tests.log || true
    410         if: ${{ always() }}
    411       - run: cat ctime_tests.log || true
    412         if: ${{ always() }}
    413       - run: cat bench.log || true
    414         if: ${{ always() }}
    415       - run: cat config.log || true
    416         if: ${{ always() }}
    417       - run: cat test_env.log || true
    418         if: ${{ always() }}
    419       - name: CI env
    420         run: env
    421         if: ${{ always() }}
    422 
    423   sanitizers_debian:
    424     name: "UBSan, ASan, LSan"
    425     runs-on: ubuntu-latest
    426     needs: docker_cache
    427 
    428     strategy:
    429       fail-fast: false
    430       matrix:
    431         configuration:
    432           - env_vars: { CC: 'clang',                                      ASM: 'auto' }
    433           - env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'auto' }
    434           - env_vars: { CC: 'clang',                                      ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
    435           - env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
    436 
    437     env:
    438       ECDH: 'yes'
    439       RECOVERY: 'yes'
    440       SCHNORRSIG: 'yes'
    441       ELLSWIFT: 'yes'
    442       CTIMETESTS: 'no'
    443       CFLAGS: '-fsanitize=undefined,address -g'
    444       UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
    445       ASAN_OPTIONS: 'strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1'
    446       LSAN_OPTIONS: 'use_unaligned=1'
    447       SECP256K1_TEST_ITERS: 32
    448 
    449     steps:
    450       - name: Checkout
    451         uses: actions/checkout@v4
    452 
    453       - name: CI script
    454         env: ${{ matrix.configuration.env_vars }}
    455         uses: ./.github/actions/run-in-docker-action
    456         with:
    457           dockerfile: ./ci/linux-debian.Dockerfile
    458           tag: linux-debian-image
    459 
    460       - run: cat tests.log || true
    461         if: ${{ always() }}
    462       - run: cat noverify_tests.log || true
    463         if: ${{ always() }}
    464       - run: cat exhaustive_tests.log || true
    465         if: ${{ always() }}
    466       - run: cat ctime_tests.log || true
    467         if: ${{ always() }}
    468       - run: cat bench.log || true
    469         if: ${{ always() }}
    470       - run: cat config.log || true
    471         if: ${{ always() }}
    472       - run: cat test_env.log || true
    473         if: ${{ always() }}
    474       - name: CI env
    475         run: env
    476         if: ${{ always() }}
    477 
    478   msan_debian:
    479     name: "MSan"
    480     runs-on: ubuntu-latest
    481     needs: docker_cache
    482 
    483     strategy:
    484       fail-fast: false
    485       matrix:
    486         configuration:
    487           - env_vars:
    488               CFLAGS: '-fsanitize=memory -fsanitize-recover=memory -g'
    489           - env_vars:
    490               ECMULTGENPRECISION: 2
    491               ECMULTWINDOW: 2
    492               CFLAGS: '-fsanitize=memory -fsanitize-recover=memory -g -O3'
    493 
    494     env:
    495       ECDH: 'yes'
    496       RECOVERY: 'yes'
    497       SCHNORRSIG: 'yes'
    498       ELLSWIFT: 'yes'
    499       CTIMETESTS: 'yes'
    500       CC: 'clang'
    501       SECP256K1_TEST_ITERS: 32
    502       ASM: 'no'
    503       WITH_VALGRIND: 'no'
    504 
    505     steps:
    506       - name: Checkout
    507         uses: actions/checkout@v4
    508 
    509       - name: CI script
    510         env: ${{ matrix.configuration.env_vars }}
    511         uses: ./.github/actions/run-in-docker-action
    512         with:
    513           dockerfile: ./ci/linux-debian.Dockerfile
    514           tag: linux-debian-image
    515 
    516       - run: cat tests.log || true
    517         if: ${{ always() }}
    518       - run: cat noverify_tests.log || true
    519         if: ${{ always() }}
    520       - run: cat exhaustive_tests.log || true
    521         if: ${{ always() }}
    522       - run: cat ctime_tests.log || true
    523         if: ${{ always() }}
    524       - run: cat bench.log || true
    525         if: ${{ always() }}
    526       - run: cat config.log || true
    527         if: ${{ always() }}
    528       - run: cat test_env.log || true
    529         if: ${{ always() }}
    530       - name: CI env
    531         run: env
    532         if: ${{ always() }}
    533 
    534   mingw_debian:
    535     name: ${{ matrix.configuration.job_name }}
    536     runs-on: ubuntu-latest
    537     needs: docker_cache
    538 
    539     env:
    540       WRAPPER_CMD: 'wine'
    541       WITH_VALGRIND: 'no'
    542       ECDH: 'yes'
    543       RECOVERY: 'yes'
    544       SCHNORRSIG: 'yes'
    545       ELLSWIFT: 'yes'
    546       CTIMETESTS: 'no'
    547 
    548     strategy:
    549       fail-fast: false
    550       matrix:
    551         configuration:
    552           - job_name: 'x86_64 (mingw32-w64): Windows (Debian stable, Wine)'
    553             env_vars:
    554               HOST: 'x86_64-w64-mingw32'
    555           - job_name: 'i686 (mingw32-w64): Windows (Debian stable, Wine)'
    556             env_vars:
    557               HOST: 'i686-w64-mingw32'
    558 
    559     steps:
    560       - name: Checkout
    561         uses: actions/checkout@v4
    562 
    563       - name: CI script
    564         env: ${{ matrix.configuration.env_vars }}
    565         uses: ./.github/actions/run-in-docker-action
    566         with:
    567           dockerfile: ./ci/linux-debian.Dockerfile
    568           tag: linux-debian-image
    569 
    570       - run: cat tests.log || true
    571         if: ${{ always() }}
    572       - run: cat noverify_tests.log || true
    573         if: ${{ always() }}
    574       - run: cat exhaustive_tests.log || true
    575         if: ${{ always() }}
    576       - run: cat ctime_tests.log || true
    577         if: ${{ always() }}
    578       - run: cat bench.log || true
    579         if: ${{ always() }}
    580       - run: cat config.log || true
    581         if: ${{ always() }}
    582       - run: cat test_env.log || true
    583         if: ${{ always() }}
    584       - name: CI env
    585         run: env
    586         if: ${{ always() }}
    587 
    588   macos-native:
    589     name: "x86_64: macOS Monterey"
    590     # See: https://github.com/actions/runner-images#available-images.
    591     runs-on: macos-12 # Use M1 once available https://github.com/github/roadmap/issues/528
    592 
    593     env:
    594       CC: 'clang'
    595       HOMEBREW_NO_AUTO_UPDATE: 1
    596       HOMEBREW_NO_INSTALL_CLEANUP: 1
    597 
    598     strategy:
    599       fail-fast: false
    600       matrix:
    601         env_vars:
    602           - { WIDEMUL: 'int64',  RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
    603           - { WIDEMUL: 'int128_struct', ECMULTGENPRECISION: 2, ECMULTWINDOW: 4 }
    604           - { WIDEMUL: 'int128',                  ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
    605           - { WIDEMUL: 'int128', RECOVERY: 'yes' }
    606           - { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
    607           - { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', CC: 'gcc' }
    608           - { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes',            WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
    609           - { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', CC: 'gcc', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
    610           - { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', CPPFLAGS: '-DVERIFY', CTIMETESTS: 'no' }
    611           - BUILD: 'distcheck'
    612 
    613     steps:
    614       - name: Checkout
    615         uses: actions/checkout@v4
    616 
    617       - name: Install Homebrew packages
    618         run: |
    619           brew install automake libtool gcc
    620           ln -s $(brew --prefix gcc)/bin/gcc-?? /usr/local/bin/gcc
    621 
    622       - name: Install and cache Valgrind
    623         uses: ./.github/actions/install-homebrew-valgrind
    624 
    625       - name: CI script
    626         env: ${{ matrix.env_vars }}
    627         run: ./ci/ci.sh
    628 
    629       - run: cat tests.log || true
    630         if: ${{ always() }}
    631       - run: cat noverify_tests.log || true
    632         if: ${{ always() }}
    633       - run: cat exhaustive_tests.log || true
    634         if: ${{ always() }}
    635       - run: cat ctime_tests.log || true
    636         if: ${{ always() }}
    637       - run: cat bench.log || true
    638         if: ${{ always() }}
    639       - run: cat config.log || true
    640         if: ${{ always() }}
    641       - run: cat test_env.log || true
    642         if: ${{ always() }}
    643       - name: CI env
    644         run: env
    645         if: ${{ always() }}
    646 
    647   win64-native:
    648     name: ${{ matrix.configuration.job_name }}
    649     # See: https://github.com/actions/runner-images#available-images.
    650     runs-on: windows-2022
    651 
    652     strategy:
    653       fail-fast: false
    654       matrix:
    655         configuration:
    656           - job_name: 'x64 (MSVC): Windows (VS 2022, shared)'
    657             cmake_options: '-A x64 -DBUILD_SHARED_LIBS=ON'
    658           - job_name: 'x64 (MSVC): Windows (VS 2022, static)'
    659             cmake_options: '-A x64 -DBUILD_SHARED_LIBS=OFF'
    660           - job_name: 'x64 (MSVC): Windows (VS 2022, int128_struct)'
    661             cmake_options: '-A x64 -DSECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY=int128_struct'
    662           - job_name: 'x64 (MSVC): Windows (VS 2022, int128_struct with __(u)mulh)'
    663             cmake_options: '-A x64 -DSECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY=int128_struct'
    664             cpp_flags: '/DSECP256K1_MSVC_MULH_TEST_OVERRIDE'
    665           - job_name: 'x86 (MSVC): Windows (VS 2022)'
    666             cmake_options: '-A Win32'
    667 
    668     steps:
    669       - name: Checkout
    670         uses: actions/checkout@v4
    671 
    672       - name: Generate buildsystem
    673         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 }}
    674 
    675       - name: Build
    676         run: cmake --build build --config RelWithDebInfo -- /p:UseMultiToolTask=true /maxCpuCount
    677 
    678       - name: Binaries info
    679         # Use the bash shell included with Git for Windows.
    680         shell: bash
    681         run: |
    682           cd build/src/RelWithDebInfo && file *tests.exe bench*.exe libsecp256k1-*.dll || true
    683 
    684       - name: Check
    685         run: |
    686           ctest -C RelWithDebInfo --test-dir build -j ([int]$env:NUMBER_OF_PROCESSORS + 1)
    687           build\src\RelWithDebInfo\bench_ecmult.exe
    688           build\src\RelWithDebInfo\bench_internal.exe
    689           build\src\RelWithDebInfo\bench.exe
    690 
    691   win64-native-headers:
    692     name: "x64 (MSVC): C++ (public headers)"
    693     # See: https://github.com/actions/runner-images#available-images.
    694     runs-on: windows-2022
    695 
    696     steps:
    697       - name: Checkout
    698         uses: actions/checkout@v4
    699 
    700       - name: Add cl.exe to PATH
    701         uses: ilammy/msvc-dev-cmd@v1
    702 
    703       - name: C++ (public headers)
    704         run: |
    705           cl.exe -c -WX -TP include/*.h
    706 
    707   cxx_fpermissive_debian:
    708     name: "C++ -fpermissive (entire project)"
    709     runs-on: ubuntu-latest
    710     needs: docker_cache
    711 
    712     env:
    713       CC: 'g++'
    714       CFLAGS: '-fpermissive -g'
    715       CPPFLAGS: '-DSECP256K1_CPLUSPLUS_TEST_OVERRIDE'
    716       WERROR_CFLAGS:
    717       ECDH: 'yes'
    718       RECOVERY: 'yes'
    719       SCHNORRSIG: 'yes'
    720       ELLSWIFT: 'yes'
    721 
    722     steps:
    723       - name: Checkout
    724         uses: actions/checkout@v4
    725 
    726       - name: CI script
    727         uses: ./.github/actions/run-in-docker-action
    728         with:
    729           dockerfile: ./ci/linux-debian.Dockerfile
    730           tag: linux-debian-image
    731 
    732       - run: cat tests.log || true
    733         if: ${{ always() }}
    734       - run: cat noverify_tests.log || true
    735         if: ${{ always() }}
    736       - run: cat exhaustive_tests.log || true
    737         if: ${{ always() }}
    738       - run: cat ctime_tests.log || true
    739         if: ${{ always() }}
    740       - run: cat bench.log || true
    741         if: ${{ always() }}
    742       - run: cat config.log || true
    743         if: ${{ always() }}
    744       - run: cat test_env.log || true
    745         if: ${{ always() }}
    746       - name: CI env
    747         run: env
    748         if: ${{ always() }}
    749 
    750   cxx_headers_debian:
    751     name: "C++ (public headers)"
    752     runs-on: ubuntu-latest
    753     needs: docker_cache
    754 
    755     steps:
    756       - name: Checkout
    757         uses: actions/checkout@v4
    758 
    759       - name: CI script
    760         uses: ./.github/actions/run-in-docker-action
    761         with:
    762           dockerfile: ./ci/linux-debian.Dockerfile
    763           tag: linux-debian-image
    764           command: |
    765             g++ -Werror include/*.h
    766             clang -Werror -x c++-header include/*.h
    767 
    768   sage:
    769     name: "SageMath prover"
    770     runs-on: ubuntu-latest
    771     container:
    772       image: sagemath/sagemath:latest
    773       options: --user root
    774 
    775     steps:
    776       - name: Checkout
    777         uses: actions/checkout@v4
    778 
    779       - name: CI script
    780         run: |
    781           cd sage
    782           sage prove_group_implementations.sage
    783 
    784   release:
    785     runs-on: ubuntu-latest
    786 
    787     steps:
    788       - name: Checkout
    789         uses: actions/checkout@v4
    790 
    791       - run: ./autogen.sh && ./configure --enable-dev-mode && make distcheck
    792 
    793       - name: Check installation with Autotools
    794         env:
    795           CI_INSTALL: ${{ runner.temp }}/${{ github.run_id }}${{ github.action }}/install
    796         run: |
    797           ./autogen.sh && ./configure --prefix=${{ env.CI_INSTALL }} && make clean && make install && ls -RlAh ${{ env.CI_INSTALL }}
    798           gcc -o ecdsa examples/ecdsa.c $(PKG_CONFIG_PATH=${{ env.CI_INSTALL }}/lib/pkgconfig pkg-config --cflags --libs libsecp256k1) -Wl,-rpath,"${{ env.CI_INSTALL }}/lib" && ./ecdsa
    799 
    800       - name: Check installation with CMake
    801         env:
    802           CI_BUILD: ${{ runner.temp }}/${{ github.run_id }}${{ github.action }}/build
    803           CI_INSTALL: ${{ runner.temp }}/${{ github.run_id }}${{ github.action }}/install
    804         run: |
    805           cmake -B ${{ env.CI_BUILD }} -DCMAKE_INSTALL_PREFIX=${{ env.CI_INSTALL }} && cmake --build ${{ env.CI_BUILD }} --target install && ls -RlAh ${{ env.CI_INSTALL }}
    806           gcc -o ecdsa examples/ecdsa.c -I ${{ env.CI_INSTALL }}/include -L ${{ env.CI_INSTALL }}/lib*/ -l secp256k1 -Wl,-rpath,"${{ env.CI_INSTALL }}/lib",-rpath,"${{ env.CI_INSTALL }}/lib64" && ./ecdsa