From b77aae9226b95d65da53dad3d418229adc25311a Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:57:48 +0100 Subject: [PATCH 1/5] ci: Rename Docker image tag to reflect architecture --- .github/workflows/ci.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3108d6b..007e8ff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: uses: docker/build-push-action@v5 with: file: ./ci/linux-debian.Dockerfile - tags: linux-debian-image + tags: x64-debian-image cache-from: type=gha cache-to: type=gha,mode=min @@ -106,7 +106,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image - name: Print logs uses: ./.github/actions/print-logs @@ -142,7 +142,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image - name: Print logs uses: ./.github/actions/print-logs @@ -174,7 +174,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image - name: Print logs uses: ./.github/actions/print-logs @@ -215,7 +215,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image - name: Print logs uses: ./.github/actions/print-logs @@ -258,7 +258,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image - name: Print logs uses: ./.github/actions/print-logs @@ -290,7 +290,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image - name: Print logs uses: ./.github/actions/print-logs @@ -333,7 +333,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image - name: Print logs uses: ./.github/actions/print-logs @@ -377,7 +377,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image - name: Print logs uses: ./.github/actions/print-logs @@ -428,7 +428,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image - name: Print logs uses: ./.github/actions/print-logs @@ -471,7 +471,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image - name: Print logs uses: ./.github/actions/print-logs @@ -678,7 +678,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image - name: Print logs uses: ./.github/actions/print-logs @@ -697,7 +697,7 @@ jobs: uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: linux-debian-image + tag: x64-debian-image command: | g++ -Werror include/*.h clang -Werror -x c++-header include/*.h From bcf77346b9d5b5084ff158c4d84f719da690d33c Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 19 Jun 2025 19:09:18 +0100 Subject: [PATCH 2/5] ci: Add `arm64` architecture to `docker_cache` job --- .github/workflows/ci.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 007e8ff9..459875d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,8 +46,18 @@ env: jobs: docker_cache: - name: "Build Docker image" - runs-on: ubuntu-latest + name: "Build ${{ matrix.arch }} Docker image" + runs-on: ${{ matrix.runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: x64 + runner: ubuntu-latest + - arch: arm64 + runner: ubuntu-24.04-arm + steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -60,7 +70,7 @@ jobs: uses: docker/build-push-action@v5 with: file: ./ci/linux-debian.Dockerfile - tags: x64-debian-image + tags: ${{ matrix.arch }}-debian-image cache-from: type=gha cache-to: type=gha,mode=min From e814b79a8b7587b39432048a170e005c9efaa1cc Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 19 Jun 2025 20:08:32 +0100 Subject: [PATCH 3/5] ci: Switch `arm64_debian` from QEMU to native `arm64` Docker image --- .github/workflows/ci.yml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 459875d2..448475e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,7 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=min - linux_debian: + x86_64-debian: name: "x86_64: Linux (Debian stable)" runs-on: ubuntu-latest needs: docker_cache @@ -231,15 +231,13 @@ jobs: uses: ./.github/actions/print-logs if: ${{ !cancelled() }} - arm64_debian: - name: "ARM64: Linux (Debian stable, QEMU)" - runs-on: ubuntu-latest + arm64-debian: + name: "arm64: Linux (Debian stable)" + runs-on: ubuntu-24.04-arm needs: docker_cache env: - WRAPPER_CMD: 'qemu-aarch64' SECP256K1_TEST_ITERS: 16 - HOST: 'aarch64-linux-gnu' WITH_VALGRIND: 'no' ECDH: 'yes' RECOVERY: 'yes' @@ -248,27 +246,25 @@ jobs: MUSIG: 'yes' ELLSWIFT: 'yes' CTIMETESTS: 'no' + CC: ${{ matrix.cc }} strategy: fail-fast: false matrix: - configuration: - - env_vars: { } # gcc - - env_vars: # clang - CC: 'clang --target=aarch64-linux-gnu' - - env_vars: # clang-snapshot - CC: 'clang-snapshot --target=aarch64-linux-gnu' + cc: + - 'gcc' + - 'clang' + - 'clang-snapshot' steps: - name: Checkout uses: actions/checkout@v4 - 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 + tag: arm64-debian-image - name: Print logs uses: ./.github/actions/print-logs From 5fafdfc30f3ed113d8037aa2e9ee12134e77df33 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 19 Jun 2025 20:09:01 +0100 Subject: [PATCH 4/5] ci: Move `gcc-snapshot` build for `arm64` from Cirrus to GHA --- .cirrus.yml | 18 ------------------ .github/workflows/ci.yml | 1 + 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 023cd191..b3a5cecb 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -63,24 +63,6 @@ linux_arm64_container_snippet: &LINUX_ARM64_CONTAINER test_script: - docker run --rm --mount "type=bind,src=./,dst=/ci_secp256k1" --env-file /tmp/env --replace --name "ci_secp256k1_arm" "ci_secp256k1_arm" bash -c "cd /ci_secp256k1/ && ./ci/ci.sh" -task: - name: "ARM64: Linux (Debian stable)" - persistent_worker: - labels: - type: arm64 - env: - ECDH: yes - RECOVERY: yes - EXTRAKEYS: yes - SCHNORRSIG: yes - MUSIG: yes - ELLSWIFT: yes - matrix: - # Currently only gcc-snapshot, the other compilers are tested on GHA with QEMU - - env: { CC: 'gcc-snapshot' } - << : *LINUX_ARM64_CONTAINER - << : *CAT_LOGS - task: name: "ARM64: Linux (Debian stable), Valgrind" persistent_worker: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 448475e7..d1e3096e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,6 +254,7 @@ jobs: cc: - 'gcc' - 'clang' + - 'gcc-snapshot' - 'clang-snapshot' steps: From 004f57fcd86de3ea8cb0e6a16f5bb665db9d1ed4 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 19 Jun 2025 20:09:36 +0100 Subject: [PATCH 5/5] ci: Move Valgrind build for `arm64` from Cirrus to GHA --- .cirrus.yml | 86 ---------------------------------------- .github/workflows/ci.yml | 38 +++++++++++++----- 2 files changed, 29 insertions(+), 95 deletions(-) delete mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index b3a5cecb..00000000 --- a/.cirrus.yml +++ /dev/null @@ -1,86 +0,0 @@ -env: - ### cirrus config - CIRRUS_CLONE_DEPTH: 1 - ### compiler options - HOST: - WRAPPER_CMD: - # Specific warnings can be disabled with -Wno-error=foo. - # -pedantic-errors is not equivalent to -Werror=pedantic and thus not implied by -Werror according to the GCC manual. - WERROR_CFLAGS: -Werror -pedantic-errors - MAKEFLAGS: -j4 - BUILD: check - ### secp256k1 config - ECMULTWINDOW: 15 - ECMULTGENKB: 22 - ASM: no - WIDEMUL: auto - WITH_VALGRIND: yes - EXTRAFLAGS: - ### secp256k1 modules - EXPERIMENTAL: no - ECDH: no - RECOVERY: no - EXTRAKEYS: no - SCHNORRSIG: no - MUSIG: no - ELLSWIFT: no - ### test options - SECP256K1_TEST_ITERS: 64 - BENCH: yes - SECP256K1_BENCH_ITERS: 2 - CTIMETESTS: yes - SYMBOL_CHECK: yes - VIRTUAL_ENV: /root/venv - # Compile and run the tests - EXAMPLES: yes - -cat_logs_snippet: &CAT_LOGS - always: - cat_tests_log_script: - - cat tests.log || true - cat_noverify_tests_log_script: - - cat noverify_tests.log || true - cat_exhaustive_tests_log_script: - - cat exhaustive_tests.log || true - cat_ctime_tests_log_script: - - cat ctime_tests.log || true - cat_bench_log_script: - - cat bench.log || true - cat_config_log_script: - - cat config.log || true - cat_test_env_script: - - cat test_env.log || true - cat_ci_env_script: - - env - -linux_arm64_container_snippet: &LINUX_ARM64_CONTAINER - env_script: - - export PATH="$VIRTUAL_ENV/bin:$PATH" - - env | tee /tmp/env - build_script: - - DOCKER_BUILDKIT=1 docker build --file "ci/linux-debian.Dockerfile" --tag="ci_secp256k1_arm" - - docker image prune --force # Cleanup stale layers - test_script: - - docker run --rm --mount "type=bind,src=./,dst=/ci_secp256k1" --env-file /tmp/env --replace --name "ci_secp256k1_arm" "ci_secp256k1_arm" bash -c "cd /ci_secp256k1/ && ./ci/ci.sh" - -task: - name: "ARM64: Linux (Debian stable), Valgrind" - persistent_worker: - labels: - type: arm64 - env: - ECDH: yes - RECOVERY: yes - EXTRAKEYS: yes - SCHNORRSIG: yes - MUSIG: yes - ELLSWIFT: yes - WRAPPER_CMD: 'valgrind --error-exitcode=42' - SECP256K1_TEST_ITERS: 2 - matrix: - - env: { CC: 'gcc' } - - env: { CC: 'clang' } - - env: { CC: 'gcc-snapshot' } - - env: { CC: 'clang-snapshot' } - << : *LINUX_ARM64_CONTAINER - << : *CAT_LOGS diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1e3096e..69c7fdf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -305,18 +305,38 @@ jobs: valgrind_debian: - name: "Valgrind (memcheck)" - runs-on: ubuntu-latest + name: "Valgrind ${{ matrix.binary_arch }} (memcheck)" + runs-on: ${{ matrix.runner }} needs: docker_cache strategy: fail-fast: false matrix: - configuration: - - env_vars: { CC: 'clang', ASM: 'auto' } - - env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'auto' } - - env_vars: { CC: 'clang', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 } - - env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 } + include: + - docker_arch: x64 + runner: ubuntu-latest + binary_arch: x64 + env_vars: { CC: 'clang', ASM: 'auto' } + - docker_arch: x64 + runner: ubuntu-latest + binary_arch: i686 + env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'auto' } + - docker_arch: arm64 + runner: ubuntu-24.04-arm + binary_arch: arm64 + env_vars: { CC: 'clang', ASM: 'auto' } + - docker_arch: x64 + runner: ubuntu-latest + binary_arch: x64 + env_vars: { CC: 'clang', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 } + - docker_arch: x64 + runner: ubuntu-latest + binary_arch: i686 + env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 } + - docker_arch: arm64 + runner: ubuntu-24.04-arm + binary_arch: arm64 + env_vars: { CC: 'clang', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 } env: # The `--error-exitcode` is required to make the test fail if valgrind found errors, @@ -336,11 +356,11 @@ jobs: uses: actions/checkout@v4 - name: CI script - env: ${{ matrix.configuration.env_vars }} + env: ${{ matrix.env_vars }} uses: ./.github/actions/run-in-docker-action with: dockerfile: ./ci/linux-debian.Dockerfile - tag: x64-debian-image + tag: ${{ matrix.docker_arch }}-debian-image - name: Print logs uses: ./.github/actions/print-logs