From ac784c797ac212ce66bf6bbd0eb1176e0d71e4c6 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Fri, 3 Apr 2020 14:20:08 +0200 Subject: [PATCH] run sanitize=address build on jenkins --- .dockerignore | 46 ++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile.jenkins | 22 ++++++++++++++++++++++ Jenkinsfile | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile.jenkins create mode 100644 Jenkinsfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6e46a23 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,46 @@ +*.lo +*.o +.deps +.libs +Dockerfile.tmp +Makefile +Makefile.fragments +Makefile.global +Makefile.objects +acinclude.m4 +aclocal.m4 +autom4te.cache/* +build/* +config.guess +config.h +config.h.in +*.log +config.nice +config.status +config.sub +configure +configure.in +configure.ac +*~ +install-sh +libtool +ltmain.sh +missing +mkinstalldirs +modules/* +v8js.la +v8js-*.tgz +run-tests.php +.*.sw[poq] + +tests/*.diff +tests/*.exp +tests/*.out +tests/*.php +tests/*.sh +tests/*.mem + +.vagrant +tmp-php.ini + +coverage_report/** diff --git a/Dockerfile.jenkins b/Dockerfile.jenkins new file mode 100644 index 0000000..e046dad --- /dev/null +++ b/Dockerfile.jenkins @@ -0,0 +1,22 @@ +ARG V8VER +FROM stesie/libv8-${V8VER}:latest + +ARG PHPVER + +ENV DEBIAN_FRONTEND=noninteractive +ENV LC_ALL=C.UTF-8 +ENV NO_INTERACTION=1 +ENV REPORT_EXIT_STATUS=1 + +RUN apt-get update -q +RUN apt-get install -y wget autoconf build-essential libxml2-dev libreadline-dev pkg-config + +RUN wget https://www.php.net/distributions/php-${PHPVER}.tar.gz && \ + tar xzf php-${PHPVER}.tar.gz +ADD . /php-${PHPVER}/ext/v8js +WORKDIR /php-${PHPVER} + +RUN ./buildconf --force +RUN ./configure --disable-all --with-readline --enable-cli --enable-json --enable-dom --enable-maintainer-zts --with-libxml --with-v8js=/opt/libv8-$V8VER/ CFLAGS="-fsanitize=address -g -O0" CXXFLAGS="-fsanitize=address -g -O0" +RUN sed -e "s/^EXTRA_LIBS.*/& -lv8_libplatform/" -i Makefile +RUN make -j5 diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..a0dffe7 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,34 @@ +pipeline { + agent none + stages { + stage('BuildAndTest') { + matrix { + agent any + axes { + axis { + name 'PHPVER' + values '7.3.16', '7.4.4' + } + axis { + name 'V8VER' + values '7.9' + } + } + stages { + stage('Build') { + steps { + echo "Building w/ V8 ${V8VER}, PHP ${PHPVER} as Docker image ${BUILD_TAG}-${V8VER}-${PHPVER}" + sh "docker build -f Dockerfile.jenkins --build-arg V8VER=${V8VER} --build-arg PHPVER=${PHPVER} -t ${BUILD_TAG}-${V8VER}-${PHPVER} ." + } + } + stage('Test') { + steps { + echo "Running test on ${BUILD_TAG}-${V8VER}-${PHPVER}" + sh "docker run --rm -t ${BUILD_TAG}-${V8VER}-${PHPVER} make test TESTS='ext/v8js/tests/*.phpt'" + } + } + } + } + } + } +}