Skip to content

CI: add ASAN, UBSAN #80

CI: add ASAN, UBSAN

CI: add ASAN, UBSAN #80

Workflow file for this run

# GitHub actions workflow.
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
name: Build+Test CI
on: [pull_request, push]
jobs:
make-check-ubuntu-x64:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
cc:
- gcc
- clang
sanitizer:
- none
- asan
- ubsan
features:
- --enable-qmanifest --enable-qtegrity
- --disable-qmanifest --enable-qtegrity
- --enable-qmanifest --disable-qtegrity
- --disable-qmanifest --disable-qtegrity
- ""
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
ASAN_OPTIONS: "detect_leaks=0" # TODO: poke at leaks in atom_explode/dotest
SANITIZER: ${{ matrix.sanitizer }}
steps:
- name: install deps
run: >
sudo apt-get install -y
libgpgme-dev gnupg2 liblz4-tool lzop zstd lzip brotli libb2-dev
- uses: actions/checkout@v2
- name: configure variant ${{ matrix.features }}
run: >
./configure
--disable-maintainer-mode --disable-openmp
${{ matrix.features }}
- name: make variant ${{ matrix.features }}
run: >
export CFLAGS="-O3 -Wall -Wshadow -pipe"
export ASAN_OPTIONS="halt_on_error=1:abort_on_error=1:print_summary=1"
export UBSAN_OPTIONS="halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1"
case "$SANITIZER" in
none)
;;
asan)
export CFLAGS="${CFLAGS} -ggdb3 -fsanitize=address"
export LDFLAGS="-fsanitize=address"
;;
ubsan)
export CFLAGS="${CFLAGS} -ggdb3 -fsanitize=undefined"
export LDFLAGS="-fsanitize=undefined"
;;
esac
make CFLAGS="${CFLAGS}" V=1 check
# I'm too tired for now to make it work
# make-check-macos-x64:
# strategy:
# matrix:
# os:
# - macos-latest
# cc:
# - clang
# runs-on: ${{ matrix.os }}
# env:
# CC: ${{ matrix.cc }}
# steps:
# - name: install deps
# run: brew install gpgme gnupg gnu-sed coreutils bash openssl
# - name: add homebrew utils to PATH
# run: |
# echo "$(brew --prefix)/opt/coreutils/libexec/gnubin" >> $GITHUB_PATH
# echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
# echo "$(brew --prefix)/opt/openssl@3/bin" >> $GITHUB_PATH
# - name: add homebrew utils to ENV
# run: |
# echo 'LDFLAGS="-L'"$(brew --prefix)/opt/openssl@3/lib ${LDFLAGS}"'"' >> $GITHUB_ENV
# echo 'CPPFLAGS="-I'"$(brew --prefix)/opt/openssl@3/include ${CPPFLAGS}"'"' >> $GITHUB_ENV
# echo 'PKG_CONFIG_PATH="'"$(brew --prefix)/opt/openssl@3/lib/pkgconfig:${PKG_CONFIG_PATH}"'"' >> $GITHUB_ENV
# - uses: actions/checkout@v2
# - name: configure
# # we need to disable qmanifest for we cannot get b2sum and
# # coreutils installed at the same time :/
# run: >
# ./configure
# --disable-maintainer-mode --disable-openmp --disable-qmanifest
# - name: make
# run: make CFLAGS="-O3 -Wall -Wshadow -pipe" V=1 check
coverity:
runs-on: ubuntu-latest
steps:
- name: install deps
run: >
sudo apt-get install -y
libgpgme-dev gnupg2 liblz4-tool lzop zstd lzip brotli libb2-dev
- uses: actions/checkout@v2
- name: configure
run: >
./configure
--disable-maintainer-mode --disable-openmp
--enable-qmanifest --enable-qtegrity
- uses: vapier/coverity-scan-action@v1
with:
email: ${{ secrets.COVERITY_SCAN_EMAIL }}
token: ${{ secrets.COVERITY_SCAN_TOKEN }}
valgrind:
runs-on: ubuntu-latest
steps:
- name: install deps
run: >
sudo apt-get install -y
libgpgme-dev gnupg2 liblz4-tool lzop zstd lzip brotli libb2-dev
valgrind
- uses: actions/checkout@v2
- name: configure
run: >
./configure
--disable-maintainer-mode --disable-openmp
--enable-qmanifest --enable-qtegrity
- name: make
run: make CFLAGS="-g -pipe" Q_RUN_WITH_VALGRIND=1 V=1 check