Explorar o código

Use Docker w/ ubuntu:xenial base image on Travis

Stefan Siegl %!s(int64=7) %!d(string=hai) anos
pai
achega
ddfb9ec012
Modificáronse 4 ficheiros con 40 adicións e 17 borrados
  1. 1 0
      .gitignore
  2. 12 6
      .travis.yml
  3. 22 0
      Dockerfile.travis
  4. 5 11
      Makefile.travis

+ 1 - 0
.gitignore

@@ -2,6 +2,7 @@
 *.o
 *.o
 .deps
 .deps
 .libs
 .libs
+Dockerfile.tmp
 Makefile
 Makefile
 Makefile.fragments
 Makefile.fragments
 Makefile.global
 Makefile.global

+ 12 - 6
.travis.yml

@@ -1,15 +1,21 @@
 language: php
 language: php
 sudo: required
 sudo: required
-dist: trusty
 
 
-php:
-  - 7.0
-  - 7.1
+services:
+  - docker
 
 
 env:
 env:
   - V8VER=6.5
   - V8VER=6.5
+    PHPVER=7.0
   - V8VER=6.3
   - V8VER=6.3
+    PHPVER=7.0
+  - V8VER=6.5
+    PHPVER=7.1
+  - V8VER=6.3
+    PHPVER=7.1
+  - V8VER=6.5
+    PHPVER=7.2
+  - V8VER=6.3
+    PHPVER=7.2
 
 
-before_install: make -f Makefile.travis before_install
-install: make -f Makefile.travis install
 script: make -f Makefile.travis test
 script: make -f Makefile.travis test

+ 22 - 0
Dockerfile.travis

@@ -0,0 +1,22 @@
+FROM ubuntu:xenial
+
+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 software-properties-common
+
+RUN add-apt-repository ppa:ondrej/php
+RUN add-apt-repository ppa:pinepain/libv8-$V8VER -y
+RUN apt-get update -q
+
+RUN apt-get install -y php$PHPVER-dev libv8-$V8VER-dev
+
+ADD . /app
+WORKDIR /app
+
+RUN phpize
+RUN ./configure CXXFLAGS="-Wall -Wno-write-strings -Werror" LDFLAGS="-lstdc++" --with-v8js=/opt/libv8-$V8VER/
+RUN make -j4

+ 5 - 11
Makefile.travis

@@ -1,20 +1,14 @@
 # Configure and build scripts for travis CI system
 # Configure and build scripts for travis CI system
 V8VER ?= 6.3
 V8VER ?= 6.3
 
 
+IMAGENAME ?= v8js-test
+
 export NO_INTERACTION=1
 export NO_INTERACTION=1
 export REPORT_EXIT_STATUS=1
 export REPORT_EXIT_STATUS=1
 
 
-before_install:
-	sudo add-apt-repository ppa:pinepain/libv8-$(V8VER) -y
-	sudo apt-get update -q
-
-install:
-	sudo apt-get install -y libv8-$(V8VER)-dev
-
 build:
 build:
-	phpize
-	./configure CXXFLAGS="-Wall -Wno-write-strings -Werror"
-	$(MAKE) -j3
+	envsubst < Dockerfile.travis > Dockerfile.tmp
+	docker build -t $(IMAGENAME) -f Dockerfile.tmp .
 
 
 test: build
 test: build
-	$(MAKE) test
+	docker run --rm -t $(IMAGENAME) make test