瀏覽代碼

run sanitize=address build on jenkins

Stefan Siegl 5 年之前
父節點
當前提交
ac784c797a
共有 3 個文件被更改,包括 102 次插入0 次删除
  1. 46 0
      .dockerignore
  2. 22 0
      Dockerfile.jenkins
  3. 34 0
      Jenkinsfile

+ 46 - 0
.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/**

+ 22 - 0
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

+ 34 - 0
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'"
+                        }
+                    }
+                }
+            }
+        }
+    }
+}