Skip to content
Snippets Groups Projects
Commit 73821d7a authored by Simon McVittie's avatar Simon McVittie
Browse files

ci: Run CI with UndefinedBehaviourSanitizer and AddressSanitizer

parent dd479a24
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -22,6 +22,11 @@ ...@@ -22,6 +22,11 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
variables: variables:
BUILD_IMAGE: 'debian:buster-slim'
CI_DISABLE_LIBRARY: ''
CI_DISTCHECK: ''
CI_MAKE_J: '-j -l2'
# A known-good version of deb-build-snapshot # A known-good version of deb-build-snapshot
DEB_BUILD_SNAPSHOT_TAG: v0.20190828.0 DEB_BUILD_SNAPSHOT_TAG: v0.20190828.0
...@@ -58,6 +63,39 @@ before_script: ...@@ -58,6 +63,39 @@ before_script:
${NULL+} ${NULL+}
.build: .build:
image: ${BUILD_IMAGE}
script: |
set -eux
NOCONFIGURE=1 ./autogen.sh
./configure \
CC=${CC-cc} \
${CI_DISABLE_LIBRARY+--disable-library} \
SANITIZE_CFLAGS="${SANITIZE_CFLAGS-}" \
${NULL+}
make ${CI_MAKE_J}
make ${CI_MAKE_J} check
if [ -n "$CI_DISTCHECK" ]; then
make ${CI_MAKE_J} distcheck
fi
artifacts:
paths:
- config.log
- test-suite.log
build:ubsan:
extends: .build
variables:
SANITIZE_CFLAGS: "-fsanitize=undefined -fno-sanitize=alignment -static-libubsan"
build:asan:
extends: .build
variables:
# The actual libcapsule library doesn't work with AddressSanitizer,
# but at least we can unit-test utility code and test the tools
CI_DISABLE_LIBRARY: "yes"
SANITIZE_CFLAGS: "-fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fPIE -pie"
.deb-build-snapshot:
image: ${BUILD_IMAGE} image: ${BUILD_IMAGE}
script: | script: |
set -eux set -eux
...@@ -80,26 +118,26 @@ before_script: ...@@ -80,26 +118,26 @@ before_script:
- debian/tmp/artifacts/${CI_JOB_NAME} - debian/tmp/artifacts/${CI_JOB_NAME}
build:stretch: build:stretch:
extends: .build extends: .deb-build-snapshot
variables: variables:
BUILD_IMAGE: 'debian:stretch-slim' BUILD_IMAGE: 'debian:stretch-slim'
build:buster: build:buster:
extends: .build extends: .deb-build-snapshot
variables: variables:
BUILD_IMAGE: 'debian:buster-slim' BUILD_IMAGE: 'debian:buster-slim'
build:bionic: build:bionic:
extends: .build extends: .deb-build-snapshot
variables: variables:
BUILD_IMAGE: 'ubuntu:bionic' BUILD_IMAGE: 'ubuntu:bionic'
LIBJPEG62: 'libjpeg62' LIBJPEG62: 'libjpeg62'
build:arch: build:arch:
when: manual when: manual
extends: .build
variables: variables:
BUILD_IMAGE: 'archlinux' BUILD_IMAGE: 'archlinux'
image: ${BUILD_IMAGE}
before_script: before_script:
# bubblewrap-suid instead of bubblewrap will be necessary on some # bubblewrap-suid instead of bubblewrap will be necessary on some
# kernels. # kernels.
...@@ -128,9 +166,3 @@ build:arch: ...@@ -128,9 +166,3 @@ build:arch:
pkgconf \ pkgconf \
sudo \ sudo \
${NULL+} ${NULL+}
script: |
NOCONFIGURE=1 ./autogen.sh
./configure
make
make check
make distcheck
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment