ci: Add support for Cirrus CI
This commit is contained in:
84
ci/cirrus.sh
Executable file
84
ci/cirrus.sh
Executable file
@@ -0,0 +1,84 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
env >> test_env.log
|
||||
|
||||
$CC -v || true
|
||||
valgrind --version || true
|
||||
|
||||
./autogen.sh
|
||||
|
||||
# Nix doesn't store GNU file in /usr/bin, see https://lists.gnu.org/archive/html/bug-libtool/2015-09/msg00000.html .
|
||||
# The -i'' is necessary for macOS portability, see https://stackoverflow.com/a/4247319 .
|
||||
sed -i'' -e 's@/usr/bin/file@$(which file)@g' configure
|
||||
|
||||
./configure \
|
||||
--enable-experimental="$EXPERIMENTAL" \
|
||||
--with-test-override-wide-multiply="$WIDEMUL" --with-bignum="$BIGNUM" --with-asm="$ASM" \
|
||||
--enable-ecmult-static-precomputation="$STATICPRECOMPUTATION" --with-ecmult-gen-precision="$ECMULTGENPRECISION" \
|
||||
--enable-module-ecdh="$ECDH" --enable-module-recovery="$RECOVERY" \
|
||||
--enable-module-schnorrsig="$SCHNORRSIG" \
|
||||
--with-valgrind="$WITH_VALGRIND" \
|
||||
--host="$HOST" $EXTRAFLAGS
|
||||
|
||||
if [ -n "$BUILD" ]
|
||||
then
|
||||
make -j2 "$BUILD"
|
||||
fi
|
||||
|
||||
if [ "$RUN_VALGRIND" = "yes" ]
|
||||
then
|
||||
make -j2
|
||||
# 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)
|
||||
valgrind --error-exitcode=42 ./tests 16
|
||||
valgrind --error-exitcode=42 ./exhaustive_tests
|
||||
fi
|
||||
|
||||
if [ -n "$QEMU_CMD" ]
|
||||
then
|
||||
make -j2
|
||||
$QEMU_CMD ./tests 16
|
||||
$QEMU_CMD ./exhaustive_tests
|
||||
fi
|
||||
|
||||
if [ "$BENCH" = "yes" ]
|
||||
then
|
||||
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
|
||||
EXEC='./libtool --mode=execute'
|
||||
if [ -n "$QEMU_CMD" ]
|
||||
then
|
||||
EXEC="$EXEC $QEMU_CMD"
|
||||
fi
|
||||
if [ "$RUN_VALGRIND" = "yes" ]
|
||||
then
|
||||
EXEC="$EXEC valgrind --error-exitcode=42"
|
||||
fi
|
||||
# This limits the iterations in the benchmarks below to ITER iterations.
|
||||
export SECP256K1_BENCH_ITERS="$ITERS"
|
||||
{
|
||||
$EXEC ./bench_ecmult
|
||||
$EXEC ./bench_internal
|
||||
$EXEC ./bench_sign
|
||||
$EXEC ./bench_verify
|
||||
} >> bench.log 2>&1
|
||||
if [ "$RECOVERY" = "yes" ]
|
||||
then
|
||||
$EXEC ./bench_recover >> bench.log 2>&1
|
||||
fi
|
||||
if [ "$ECDH" = "yes" ]
|
||||
then
|
||||
$EXEC ./bench_ecdh >> bench.log 2>&1
|
||||
fi
|
||||
if [ "$SCHNORRSIG" = "yes" ]
|
||||
then
|
||||
$EXEC ./bench_schnorrsig >> bench.log 2>&1
|
||||
fi
|
||||
fi
|
||||
if [ "$CTIMETEST" = "yes" ]
|
||||
then
|
||||
./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
|
||||
fi
|
||||
6
ci/linux-debian-s390-qemu.Dockerfile
Normal file
6
ci/linux-debian-s390-qemu.Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM debian
|
||||
|
||||
RUN dpkg --add-architecture s390x
|
||||
RUN apt-get update
|
||||
RUN apt-get install --no-install-recommends --no-upgrade -y make automake libtool
|
||||
RUN apt-get install --no-install-recommends --no-upgrade -y gcc-s390x-linux-gnu libc6-dev-s390x-cross qemu-user libc6:s390x
|
||||
12
ci/linux-nixos.Dockerfile
Normal file
12
ci/linux-nixos.Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM nixos/nix
|
||||
|
||||
COPY ci/shell.nix /tmp
|
||||
COPY ci/shell-i686.nix /tmp
|
||||
|
||||
RUN nix-channel --remove nixpkgs
|
||||
RUN nix-channel --add https://nixos.org/channels/nixos-20.09 nixpkgs
|
||||
RUN nix-channel --update
|
||||
|
||||
# Run dummy command "true" in the nix-shell just to get the packages prepared.
|
||||
RUN nix-shell /tmp/shell.nix --command true
|
||||
RUN nix-shell /tmp/shell-i686.nix --command true
|
||||
9
ci/shell-i686.nix
Normal file
9
ci/shell-i686.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
with (import <nixpkgs> {}).pkgsi686Linux;
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
bash file pkgconfig autoconf automake libtool gmp valgrind clang gcc
|
||||
];
|
||||
shellHook = ''
|
||||
echo Running nix-shell with nixpkgs version: $(nix eval --raw nixpkgs.lib.version)
|
||||
'';
|
||||
}
|
||||
9
ci/shell.nix
Normal file
9
ci/shell.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
with (import <nixpkgs> {});
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
bash file pkgconfig autoconf automake libtool gmp valgrind clang gcc
|
||||
];
|
||||
shellHook = ''
|
||||
echo Running nix-shell with nixpkgs version: $(nix eval --raw nixpkgs.lib.version)
|
||||
'';
|
||||
}
|
||||
68
ci/travis.sh
Executable file
68
ci/travis.sh
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
if [ "$HOST" = "i686-linux-gnu" ]
|
||||
then
|
||||
export CC="$CC -m32"
|
||||
fi
|
||||
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$TRAVIS_COMPILER" = "gcc" ]
|
||||
then
|
||||
export CC="gcc-9"
|
||||
fi
|
||||
|
||||
./configure \
|
||||
--enable-experimental="$EXPERIMENTAL" \
|
||||
--with-test-override-wide-multiply="$WIDEMUL" --with-bignum="$BIGNUM" --with-asm="$ASM" \
|
||||
--enable-ecmult-static-precomputation="$STATICPRECOMPUTATION" --with-ecmult-gen-precision="$ECMULTGENPRECISION" \
|
||||
--enable-module-ecdh="$ECDH" --enable-module-recovery="$RECOVERY" \
|
||||
--enable-module-schnorrsig="$SCHNORRSIG" \
|
||||
--with-valgrind="$WITH_VALGRIND" \
|
||||
--host="$HOST" $EXTRAFLAGS
|
||||
|
||||
if [ -n "$BUILD" ]
|
||||
then
|
||||
make -j2 "$BUILD"
|
||||
fi
|
||||
if [ "$RUN_VALGRIND" = "yes" ]
|
||||
then
|
||||
make -j2
|
||||
# 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)
|
||||
valgrind --error-exitcode=42 ./tests 16
|
||||
valgrind --error-exitcode=42 ./exhaustive_tests
|
||||
fi
|
||||
if [ "$BENCH" = "yes" ]
|
||||
then
|
||||
if [ "$RUN_VALGRIND" = "yes" ]
|
||||
then
|
||||
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
|
||||
EXEC='./libtool --mode=execute valgrind --error-exitcode=42'
|
||||
else
|
||||
EXEC=
|
||||
fi
|
||||
# This limits the iterations in the benchmarks below to ITER(set in .travis.yml) iterations.
|
||||
export SECP256K1_BENCH_ITERS="$ITERS"
|
||||
{
|
||||
$EXEC ./bench_ecmult
|
||||
$EXEC ./bench_internal
|
||||
$EXEC ./bench_sign
|
||||
$EXEC ./bench_verify
|
||||
} >> bench.log 2>&1
|
||||
if [ "$RECOVERY" = "yes" ]
|
||||
then
|
||||
$EXEC ./bench_recover >> bench.log 2>&1
|
||||
fi
|
||||
if [ "$ECDH" = "yes" ]
|
||||
then
|
||||
$EXEC ./bench_ecdh >> bench.log 2>&1
|
||||
fi
|
||||
if [ "$SCHNORRSIG" = "yes" ]
|
||||
then
|
||||
$EXEC ./bench_schnorrsig >> bench.log 2>&1
|
||||
fi
|
||||
fi
|
||||
if [ "$CTIMETEST" = "yes" ]
|
||||
then
|
||||
./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
|
||||
fi
|
||||
Reference in New Issue
Block a user