- sanitizers now do the full test run, as in every other job.
- run all test flavors even if one of them fails.
- change big-endian cross build to little-endian MIPS.
if [ -n "${HOST:-}" ]; then
case "$HOST" in
armhf) triplet=arm-linux-gnueabihf ;;
- mips) triplet=mips-linux-gnu ;;
+ mipsel) triplet=mipsel-linux-gnu ;;
*) exit 1 ;;
esac
+++ /dev/null
-#!/bin/bash
-
-set -euo pipefail
-
-dir=$(realpath "$(dirname "$0")")
-
-case "$SANITIZER" in
-undefined)
- flags='-fsanitize=integer -fsanitize=nullability'
- ;;
-
-address)
- flags='-fsanitize-address-use-after-scope -fsanitize=pointer-compare -fsanitize=pointer-subtract'
- ;;
-
-*)
- flags=''
- ;;
-esac
-
-export CPPFLAGS='-DDEBUG'
-export CFLAGS="-O0 -g -fsanitize=$SANITIZER -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=$dir/ignore.txt $flags"
-
-autoreconf -fsi
-# shellcheck disable=SC2046
-./configure $(sh .ci/conf.sh)
-make -j2 all extra
set -euo pipefail
+dir=$(realpath "$(dirname "$0")")
+
logs="$GITHUB_WORKSPACE/sanitizer"
-mkdir -p "$logs"
case "$SANITIZER" in
+undefined)
+ flags='-fsanitize=integer -fsanitize=nullability'
+ export UBSAN_OPTIONS="log_path=$logs/ubsan:print_stacktrace=1"
+ ;;
+
address)
+ flags='-fsanitize-address-use-after-scope -fsanitize=pointer-compare -fsanitize=pointer-subtract'
export ASAN_OPTIONS="log_path=$logs/asan:detect_invalid_pointer_pairs=2:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1"
;;
thread)
+ flags=''
export TSAN_OPTIONS="log_path=$logs/tsan"
;;
-undefined)
- export UBSAN_OPTIONS="log_path=$logs/ubsan:print_stacktrace=1"
- ;;
-
*)
echo >&2 "unknown sanitizer $SANITIZER"
exit 1
;;
esac
-sudo --preserve-env=ASAN_OPTIONS,TSAN_OPTIONS,UBSAN_OPTIONS \
- make check VERBOSE=1
+export CC='clang-12'
+export CPPFLAGS='-DDEBUG'
+export CFLAGS="-O0 -g -fsanitize=$SANITIZER -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=$dir/ignore.txt $flags"
+
+bash .ci/test/run.sh "$@"
# Check that the sanitizer has not created any log files.
# If it has, fail the job to notify the developer.
sudo git clean -dfx
sudo chown -R "${USER:-$(whoami)}" .
+ mkdir -p sanitizer /tmp/logs
+
header "Running test flavor $flavor"
autoreconf -fsi
code=0
make check -j2 VERBOSE=1 || code=$?
- mkdir -p /tmp/logs
- sudo tar -c -z -f "/tmp/logs/tests.$flavor.tar.gz" test/
+ sudo tar -c -z -f "/tmp/logs/tests.$flavor.tar.gz" test/ sanitizer/
return $code
}
-echo "system name $(uname -s)"
-echo "full $(uname -a)"
-echo "o $(uname -o)"
-
case "$(uname -s)" in
Linux)
if [ -n "${HOST:-}" ]; then
# Needed for cross-compilation for 32-bit targets.
- export CPPFLAGS='-D_FILE_OFFSET_BITS=64'
+ export CPPFLAGS="${CPPFLAGS:-} -D_FILE_OFFSET_BITS=64"
fi
;;
nproc() { sysctl -n hw.ncpu; }
gcrypt=$(brew --prefix libgcrypt)
openssl=$(brew --prefix openssl)
- export CPPFLAGS="-I/usr/local/include -I$gcrypt/include -I$openssl/include -I$gcrypt/include"
+ export CPPFLAGS="${CPPFLAGS:-} -I/usr/local/include -I$gcrypt/include -I$openssl/include -I$gcrypt/include"
;;
esac
matrix:
arch:
- armhf
- - mips
+ - mipsel
container:
- image: debian:buster
+ image: debian:bullseye
options: --privileged
steps:
- name: Prepare the system
run: |
sh .ci/test/prepare.sh
+ update-binfmts --enable
rm -f /dev/net/tun
- name: Run tests with default settings
- name: Run tests without legacy protocol
run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh nolegacy
+ if: always()
- name: Run tests with libgcrypt
run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh gcrypt
- name: Upload test results
uses: actions/upload-artifact@v2
with:
- name: tests_cross_${{ env.ARTIFACT }}
+ name: tests_cross_${{ matrix.arch }}
path: /tmp/logs/tests.*.tar.gz
if: always()
- name: Install deps
run: sudo sh .ci/deps.sh
- - name: Configure and compile
- shell: bash
- run: bash .ci/sanitizers/build.sh
- env:
- CC: clang-12
+ - name: Sanitize tests with default settings
+ run: bash .ci/sanitizers/run.sh default
- - name: Run tests
- run: bash .ci/sanitizers/run.sh
-
- - name: Archive test results
- run: sudo tar -c -z -f test-results.tar.gz test/ sanitizer/
+ - name: Sanitize tests without legacy protocol
+ run: bash .ci/sanitizers/run.sh nolegacy
if: always()
- name: Upload test results
uses: actions/upload-artifact@v2
with:
- name: tests_sanitizer_${{ matrix.sanitizer }}
- path: test-results.tar.gz
+ name: tests_${{ env.ARTIFACT }}
+ path: /tmp/logs/tests.*.tar.gz
if: always()
linux:
- name: Run tests without legacy protocol
run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
+ if: always()
- name: Run tests with libgcrypt
run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
- name: Run tests without legacy protocol
run: sh .ci/test/run.sh nolegacy
+ if: always()
- name: Run tests with libgcrypt
run: sh .ci/test/run.sh gcrypt
- name: Run tests without legacy protocol
shell: msys2 {0}
run: sh .ci/test/run.sh nolegacy
+ if: always()
- name: Run tests with libgcrypt
shell: msys2 {0}