Skip to content

Commit c22ac27

Browse files
committed
ci: Move sanitizers task from Cirrus to GitHub Actions
1 parent 26a9899 commit c22ac27

File tree

2 files changed

+115
-44
lines changed

2 files changed

+115
-44
lines changed

.cirrus.yml

-44
Original file line numberDiff line numberDiff line change
@@ -64,50 +64,6 @@ linux_container_snippet: &LINUX_CONTAINER
6464
# More than enough for our scripts.
6565
memory: 2G
6666

67-
# Sanitizers
68-
task:
69-
<< : *LINUX_CONTAINER
70-
env:
71-
ECDH: yes
72-
RECOVERY: yes
73-
SCHNORRSIG: yes
74-
ELLSWIFT: yes
75-
CTIMETESTS: no
76-
matrix:
77-
- name: "Valgrind (memcheck)"
78-
container:
79-
cpu: 2
80-
env:
81-
# The `--error-exitcode` is required to make the test fail if valgrind found errors, otherwise it'll return 0 (https://www.valgrind.org/docs/manual/manual-core.html)
82-
WRAPPER_CMD: "valgrind --error-exitcode=42"
83-
SECP256K1_TEST_ITERS: 2
84-
- name: "UBSan, ASan, LSan"
85-
container:
86-
memory: 2G
87-
env:
88-
CFLAGS: "-fsanitize=undefined,address -g"
89-
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
90-
ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1"
91-
LSAN_OPTIONS: "use_unaligned=1"
92-
SECP256K1_TEST_ITERS: 32
93-
# Try to cover many configurations with just a tiny matrix.
94-
matrix:
95-
- env:
96-
ASM: auto
97-
- env:
98-
ASM: no
99-
ECMULTGENPRECISION: 2
100-
ECMULTWINDOW: 2
101-
matrix:
102-
- env:
103-
CC: clang
104-
- env:
105-
HOST: i686-linux-gnu
106-
CC: i686-linux-gnu-gcc
107-
test_script:
108-
- ./ci/ci.sh
109-
<< : *CAT_LOGS
110-
11167
# Memory sanitizers
11268
task:
11369
<< : *LINUX_CONTAINER

.github/workflows/ci.yml

+115
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,121 @@ jobs:
373373
run: env
374374
if: ${{ always() }}
375375

376+
valgrind_debian:
377+
name: "Valgrind (memcheck)"
378+
runs-on: ubuntu-latest
379+
needs: docker_cache
380+
381+
strategy:
382+
fail-fast: false
383+
matrix:
384+
configuration:
385+
- env_vars: { CC: 'clang', ASM: 'auto' }
386+
- env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'auto' }
387+
- env_vars: { CC: 'clang', ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
388+
- env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
389+
390+
env:
391+
# The `--error-exitcode` is required to make the test fail if valgrind found errors,
392+
# otherwise it will return 0 (https://www.valgrind.org/docs/manual/manual-core.html).
393+
WRAPPER_CMD: 'valgrind --error-exitcode=42'
394+
ECDH: 'yes'
395+
RECOVERY: 'yes'
396+
SCHNORRSIG: 'yes'
397+
ELLSWIFT: 'yes'
398+
CTIMETESTS: 'no'
399+
SECP256K1_TEST_ITERS: 2
400+
401+
steps:
402+
- name: Checkout
403+
uses: actions/checkout@v3
404+
405+
- name: CI script
406+
env: ${{ matrix.configuration.env_vars }}
407+
uses: ./.github/actions/run-in-docker-action
408+
with:
409+
dockerfile: ./ci/linux-debian.Dockerfile
410+
tag: linux-debian-image
411+
command: >
412+
git config --global --add safe.directory ${{ github.workspace }} &&
413+
./ci/ci.sh
414+
415+
- run: cat tests.log || true
416+
if: ${{ always() }}
417+
- run: cat noverify_tests.log || true
418+
if: ${{ always() }}
419+
- run: cat exhaustive_tests.log || true
420+
if: ${{ always() }}
421+
- run: cat ctime_tests.log || true
422+
if: ${{ always() }}
423+
- run: cat bench.log || true
424+
if: ${{ always() }}
425+
- run: cat config.log || true
426+
if: ${{ always() }}
427+
- run: cat test_env.log || true
428+
if: ${{ always() }}
429+
- name: CI env
430+
run: env
431+
if: ${{ always() }}
432+
433+
sanitizers_debian:
434+
name: "UBSan, ASan, LSan"
435+
runs-on: ubuntu-latest
436+
needs: docker_cache
437+
438+
strategy:
439+
fail-fast: false
440+
matrix:
441+
configuration:
442+
- env_vars: { CC: 'clang', ASM: 'auto' }
443+
- env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'auto' }
444+
- env_vars: { CC: 'clang', ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
445+
- env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
446+
447+
env:
448+
ECDH: 'yes'
449+
RECOVERY: 'yes'
450+
SCHNORRSIG: 'yes'
451+
ELLSWIFT: 'yes'
452+
CTIMETESTS: 'no'
453+
CFLAGS: '-fsanitize=undefined,address -g'
454+
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
455+
ASAN_OPTIONS: 'strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1'
456+
LSAN_OPTIONS: 'use_unaligned=1'
457+
SECP256K1_TEST_ITERS: 32
458+
459+
steps:
460+
- name: Checkout
461+
uses: actions/checkout@v3
462+
463+
- name: CI script
464+
env: ${{ matrix.configuration.env_vars }}
465+
uses: ./.github/actions/run-in-docker-action
466+
with:
467+
dockerfile: ./ci/linux-debian.Dockerfile
468+
tag: linux-debian-image
469+
command: >
470+
git config --global --add safe.directory ${{ github.workspace }} &&
471+
./ci/ci.sh
472+
473+
- run: cat tests.log || true
474+
if: ${{ always() }}
475+
- run: cat noverify_tests.log || true
476+
if: ${{ always() }}
477+
- run: cat exhaustive_tests.log || true
478+
if: ${{ always() }}
479+
- run: cat ctime_tests.log || true
480+
if: ${{ always() }}
481+
- run: cat bench.log || true
482+
if: ${{ always() }}
483+
- run: cat config.log || true
484+
if: ${{ always() }}
485+
- run: cat test_env.log || true
486+
if: ${{ always() }}
487+
- name: CI env
488+
run: env
489+
if: ${{ always() }}
490+
376491
mingw_debian:
377492
name: ${{ matrix.configuration.job_name }}
378493
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)