Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable tests with sanitizers on github actions #297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/build-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,32 @@ BUILD_LIBSODIUM=${BUILD_LIBSODIUM:-1}
BUILD_WEBRTC=${BUILD_WEBRTC:-1}

# Sanitizers aren't supported on MinGW
[[ "${uname_S}" == MINGW* ]] && BUILD_SANITIZERS=0
[[ "${uname_S}" == MINGW* ]] && BUILD_SANITIZERS=0 && echo "disabling sanitizers on MinGW"

# Noticed that Clang's tsan and asan don't behave well on non-x86_64 Travis
# builders, so let's just disable them on there.
[[ "${uname_M}" != x86_64 ]] && [[ ${CXX} == *clang* ]] && BUILD_SANITIZERS=0
[[ "${uname_M}" != x86_64 ]] && [[ ${CXX} == *clang* ]] && BUILD_SANITIZERS=0 && echo "disabling sanitizers on non-x86_64 with clang"

# Sanitizers don't link properly with clang on Fedora Rawhide
[[ "${IMAGE}" == "fedora" ]] && [[ "${IMAGE_TAG}" == "rawhide" ]] && [[ ${CXX} == *clang* ]] && BUILD_SANITIZERS=0
[[ "${IMAGE}" == "fedora" ]] && [[ "${IMAGE_TAG}" == "rawhide" ]] && [[ ${CXX} == *clang* ]] && BUILD_SANITIZERS=0 && echo "disabling sanitizers on fedora Rawhide"

# Sanitizers don't link properly with clang on Ubuntu Rolling
[[ "${IMAGE}" == "ubuntu" ]] && [[ "${IMAGE_TAG}" == "rolling" ]] && [[ ${CXX} == *clang* ]] && BUILD_SANITIZERS=0
[[ "${IMAGE}" == "ubuntu" ]] && [[ "${IMAGE_TAG}" == "rolling" ]] && [[ ${CXX} == *clang* ]] && BUILD_SANITIZERS=0 && echo "disabling sanitizers on ubuntu rolling with clang"

# Something's wrong with the GCC -fsanitize=address build on the s390x Travis
# builder, and it fails to link properly.
[[ ${uname_M} == s390x ]] && BUILD_SANITIZERS=0
[[ ${uname_M} == s390x ]] && BUILD_SANITIZERS=0 && echo "disabling sanitizers on s390x"

# clang with sanitizers results in link errors on i686 Ubuntu at any rate
[[ ${CXX} == *clang* ]] && [[ "$(${CXX} -dumpmachine)" == i686-* ]] && BUILD_SANITIZERS=0
[[ ${CXX} == *clang* ]] && [[ "$(${CXX} -dumpmachine)" == i686-* ]] && BUILD_SANITIZERS=0 && echo "disabling sanitizers on i686 ubuntu"

# Big-endian platforms can't build with WebRTC out-of-the-box.
[[ ${uname_M} == s390x ]] && BUILD_WEBRTC=0
[[ ${uname_M} == powerpc ]] && BUILD_WEBRTC=0
[[ ${uname_M} == ppc64* ]] && BUILD_WEBRTC=0

# Foreign architecture docker containers don't support sanitizers.
[[ ${uname_M} != x86_64 ]] && grep -q -e AuthenticAMD -e GenuineIntel /proc/cpuinfo && BUILD_SANITIZERS=0
[[ ${uname_M} != x86_64 ]] && grep -q -e AuthenticAMD -e GenuineIntel /proc/cpuinfo && BUILD_SANITIZERS=0 && echo "disabling sanitizers on foreign architecture docker"

# libsodium's AES implementation only works on x86_64
[[ ${uname_M} != x86_64 ]] && BUILD_LIBSODIUM=0
Expand Down
3 changes: 3 additions & 0 deletions .github/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export BUILD_SANITIZERS=0
if [[ "$IMAGE" == "ubuntu" ]] && [[ "$IMAGE_TAG" == "rolling" ]]; then
export BUILD_SANITIZERS=1
fi
if [[ "$IMAGE" == "ubuntu" ]] && [[ "$IMAGE_TAG" == "latest" ]]; then
export BUILD_SANITIZERS=1
fi
if [[ "$IMAGE" == "fedora" ]] && [[ "$IMAGE_TAG" == "rawhide" ]]; then
export BUILD_SANITIZERS=1
fi
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ on: [push, pull_request]

jobs:

trigger-linux-flavors:
#if: false # Temporarily disable
name: Trigger linux flavors
runs-on: ubuntu-latest
env:
CI_BUILD: 1
IMAGE: ubuntu
IMAGE_TAG: latest
steps:
# Trigger testing of more linux flavors
- name: Trigger linux flavors build
uses: peter-evans/repository-dispatch@main
with:
event-type: build-linux-flavors

build-and-test-ubuntu:
#if: false # Temporarily disable
name: Build And Test Ubuntu
Expand All @@ -23,12 +38,6 @@ jobs:
- name: Build and run tests
run: bash .github/build.sh

# Trigger testing of more linux flavors
- name: Trigger linux flavors build
uses: peter-evans/repository-dispatch@v2
with:
event-type: build-linux-flavors

build-and-test-windows:
#if: false # Temporarily disable
name: Build And Test Windows
Expand Down