diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-10-31 13:51:32 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-11-02 15:27:40 +1100 |
commit | 99f146145c49e960af6e7da9391908cb30617227 (patch) | |
tree | b3ede2e0beaa0eafae02d77270f07c846beef375 | |
parent | ed9c11c90d30484072a3d39d8b6660992699198e (diff) | |
download | skiboot-99f146145c49e960af6e7da9391908cb30617227.zip skiboot-99f146145c49e960af6e7da9391908cb30617227.tar.gz skiboot-99f146145c49e960af6e7da9391908cb30617227.tar.bz2 |
travis-ci: use Docker containers for a matrix of platforms
This greatly simplifies the build process for travis, yet makes it more
powerful and increases coverage without increasing wall time to test.
Travis has the concept of a build matrix, and we want to ensure we continue
to build succesfully on a variety of platforms and compiler combinations.
We limit what we run on some OSs to conserve vital sanity.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | .travis.yml | 59 | ||||
-rw-r--r-- | Makefile.main | 2 | ||||
-rw-r--r-- | opal-ci/Dockerfile-centos6 | 9 | ||||
-rw-r--r-- | opal-ci/Dockerfile-centos7 | 10 | ||||
-rw-r--r-- | opal-ci/Dockerfile-fedora24 | 6 | ||||
-rw-r--r-- | opal-ci/Dockerfile-ubuntu-12.04 | 19 | ||||
-rw-r--r-- | opal-ci/Dockerfile-ubuntu-16.04 | 12 | ||||
-rw-r--r-- | opal-ci/Dockerfile-ubuntu-latest | 12 | ||||
-rwxr-xr-x | opal-ci/build-centos6.sh | 27 | ||||
-rwxr-xr-x | opal-ci/build-fedora24.sh | 25 | ||||
-rwxr-xr-x | opal-ci/build-ubuntu-12.04.sh | 24 | ||||
-rwxr-xr-x | opal-ci/build-ubuntu-16.04.sh | 24 |
12 files changed, 199 insertions, 30 deletions
diff --git a/.travis.yml b/.travis.yml index de21952..a0fe33e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,41 +1,42 @@ language: c -sudo: required -dist: trusty - -before_install: - - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt - - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - - sudo apt-get update -qq - - sudo apt-get install -y gcc-4.8 libstdc++6 valgrind expect xterm - - sudo apt-get install -y gcc-arm-linux-gnueabi gcc-powerpc64le-linux-gnu gcc - - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 - - wget https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.8.0/x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz - - sudo mkdir /opt/cross - - sudo tar -C /opt/cross -xvf x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz - - wget ftp://public.dhe.ibm.com/software/server/powerfuncsim/p8/packages/v1.0-2/systemsim-p8_1.0-2_amd64.deb - - sudo dpkg -i systemsim-p8_1.0-2_amd64.deb - - ./opal-ci/install-deps-qemu-powernv.sh - env: + matrix: + - RUN_ON_CONTAINER=ubuntu-12.04 + - RUN_ON_CONTAINER=ubuntu-16.04 + - RUN_ON_CONTAINER=ubuntu-latest + - RUN_ON_CONTAINER=centos6 + - RUN_ON_CONTAINER=centos7 + - RUN_ON_CONTAINER=fedora24 global: - - CROSS=/opt/cross/gcc-4.8.0-nolibc/powerpc64-linux/bin/powerpc64-linux- - - HOSTCC=gcc-4.8 # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created # via the "travis encrypt" command using the project repo's public key - - secure: "MpNEGFa1VrF/vsQq24n5UgfRbz1wVC6B8mubFnyK4gX0IuQ9xhWuTzMLUQF9UJxe5jnC2DTmVUvYTYN/hggw+PpYwbOOAE0QGR5pmPHA4PSRmc5pxt1q18/sv7EPFw66GFyWJq94nWjpigyKQ8KGtA67j1xFqrDoS43OA76WZgo=" + secure: "MpNEGFa1VrF/vsQq24n5UgfRbz1wVC6B8mubFnyK4gX0IuQ9xhWuTzMLUQF9UJxe5jnC2DTmVUvYTYN/hggw+PpYwbOOAE0QGR5pmPHA4PSRmc5pxt1q18/sv7EPFw66GFyWJq94nWjpigyKQ8KGtA67j1xFqrDoS43OA76WZgo=" + +sudo: required +services: docker + +dist: trusty + +before_install: + - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt script: - - if [ ${COVERITY_SCAN_BRANCH} != 1 ]; then - (cd opal-ci; ./build-qemu-powernv.sh) && - ./opal-ci/fetch-debian-jessie-installer.sh && - make -j4 all check ; (make clean; cd external/gard && CROSS= make) && - (cd external/pflash; ./build-all-arch.sh) && - make clean && SKIBOOT_GCOV=1 make && SKIBOOT_GCOV=1 make check && - make clean && rm -rf builddir && mkdir builddir && make SRC=`pwd` -f ../Makefile -C builddir && - make clean; - fi + - if [ ${COVERITY_SCAN_BRANCH} != 1 ]; then + docker build -t ${RUN_ON_CONTAINER} -f opal-ci/Dockerfile-${RUN_ON_CONTAINER} . && + docker run --rm -t $RUN_ON_CONTAINER; + fi + - if [ ${COVERITY_SCAN_BRANCH} == 1 ]; then + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && + sudo apt-get update -qq && + sudo apt-get install -y gcc-4.8 libstdc++6 valgrind expect xterm && + sudo apt-get install -y gcc-arm-linux-gnueabi gcc-powerpc64le-linux-gnu gcc && + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 && + wget https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.8.0/x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz && + sudo mkdir /opt/cross && + sudo tar -C /opt/cross -xvf x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz; + fi addons: coverity_scan: diff --git a/Makefile.main b/Makefile.main index 7918a18..62a659d 100644 --- a/Makefile.main +++ b/Makefile.main @@ -193,7 +193,7 @@ $(TARGET).elf: $(ALL_OBJS_2) $(TARGET).lds $(KERNEL) $(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(ALL_OBJS_2) -o $@, $@) $(SUBDIRS): - $(call Q,MKDIR,mkdir $@, $@) + $(call Q,MKDIR,mkdir -p $@, $@) -include $(wildcard *.d) -include $(wildcard $(SUBDIRS:%=%/*.d)) diff --git a/opal-ci/Dockerfile-centos6 b/opal-ci/Dockerfile-centos6 new file mode 100644 index 0000000..5cd9a7a --- /dev/null +++ b/opal-ci/Dockerfile-centos6 @@ -0,0 +1,9 @@ +FROM centos:6 +RUN yum -y update && yum clean all +RUN yum -y install wget xterm gcc git xz +RUN wget https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.8.0/x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz +RUN mkdir /opt/cross +RUN tar -C /opt/cross -xf x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz +COPY . /build/ +WORKDIR /build +ENTRYPOINT ./opal-ci/build-centos6.sh diff --git a/opal-ci/Dockerfile-centos7 b/opal-ci/Dockerfile-centos7 new file mode 100644 index 0000000..c9d4c87 --- /dev/null +++ b/opal-ci/Dockerfile-centos7 @@ -0,0 +1,10 @@ +FROM centos:7 +RUN yum -y update && yum clean all +RUN yum -y install wget xterm gcc git xz make diffutils findutils expect valgrind valgrind-devel +RUN wget https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.8.0/x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz +RUN mkdir /opt/cross +RUN tar -C /opt/cross -xf x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz +COPY . /build/ +WORKDIR /build +# We don't have a custom centos 7 build, same script for now +ENTRYPOINT ./opal-ci/build-centos6.sh diff --git a/opal-ci/Dockerfile-fedora24 b/opal-ci/Dockerfile-fedora24 new file mode 100644 index 0000000..7caa884 --- /dev/null +++ b/opal-ci/Dockerfile-fedora24 @@ -0,0 +1,6 @@ +FROM fedora:24 +RUN dnf -y install wget xterm gcc git xz make diffutils findutils expect valgrind valgrind-devel +RUN dnf -y install gcc-powerpc64-linux-gnu +COPY . /build/ +WORKDIR /build +ENTRYPOINT ./opal-ci/build-fedora24.sh diff --git a/opal-ci/Dockerfile-ubuntu-12.04 b/opal-ci/Dockerfile-ubuntu-12.04 new file mode 100644 index 0000000..42026a2 --- /dev/null +++ b/opal-ci/Dockerfile-ubuntu-12.04 @@ -0,0 +1,19 @@ +FROM ubuntu:trusty +RUN sudo apt-get update -qq +RUN sudo apt-get install -y software-properties-common +RUN sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test +RUN sudo apt-get update -qq +RUN sudo apt-get install -y gcc-4.8 libstdc++6 valgrind expect xterm +RUN sudo apt-get install -y gcc-arm-linux-gnueabi gcc-powerpc64le-linux-gnu gcc +RUN sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 +RUN sudo apt-get install -y wget +RUN wget https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.8.0/x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz +RUN sudo mkdir /opt/cross +RUN sudo tar -C /opt/cross -xf x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz +RUN wget ftp://public.dhe.ibm.com/software/server/powerfuncsim/p8/packages/v1.0-2/systemsim-p8_1.0-2_amd64.deb +RUN sudo dpkg -i systemsim-p8_1.0-2_amd64.deb +RUN sudo apt-get -y install eatmydata +RUN sudo eatmydata apt-get -y install build-essential gcc python g++ pkg-config libz-dev libglib2.0-dev libpixman-1-dev libfdt-dev git libstdc++6 +COPY . /build/ +WORKDIR /build +ENTRYPOINT ./opal-ci/build-ubuntu-12.04.sh diff --git a/opal-ci/Dockerfile-ubuntu-16.04 b/opal-ci/Dockerfile-ubuntu-16.04 new file mode 100644 index 0000000..2fb299b --- /dev/null +++ b/opal-ci/Dockerfile-ubuntu-16.04 @@ -0,0 +1,12 @@ +FROM ubuntu:16.04 +RUN apt-get update -qq +RUN apt-get install -y gcc-powerpc64le-linux-gnu gcc +RUN apt-get install -y wget xterm +RUN apt-get install -y gcc-arm-linux-gnueabi +RUN wget ftp://public.dhe.ibm.com/software/server/powerfuncsim/p8/packages/v1.0-2/systemsim-p8_1.0-2_amd64.deb +RUN dpkg -i systemsim-p8_1.0-2_amd64.deb +RUN apt-get -y install eatmydata +RUN eatmydata apt-get -y install build-essential gcc python g++ pkg-config libz-dev libglib2.0-dev libpixman-1-dev libfdt-dev git libstdc++6 valgrind +COPY . /build/ +WORKDIR /build +ENTRYPOINT ./opal-ci/build-ubuntu-16.04.sh diff --git a/opal-ci/Dockerfile-ubuntu-latest b/opal-ci/Dockerfile-ubuntu-latest new file mode 100644 index 0000000..28fb904 --- /dev/null +++ b/opal-ci/Dockerfile-ubuntu-latest @@ -0,0 +1,12 @@ +FROM ubuntu:latest +RUN apt-get update -qq +RUN apt-get install -y gcc-powerpc64le-linux-gnu gcc +RUN apt-get install -y wget xterm +RUN apt-get install -y gcc-arm-linux-gnueabi +RUN wget ftp://public.dhe.ibm.com/software/server/powerfuncsim/p8/packages/v1.0-2/systemsim-p8_1.0-2_amd64.deb +RUN dpkg -i systemsim-p8_1.0-2_amd64.deb +RUN apt-get -y install eatmydata +RUN eatmydata apt-get -y install build-essential gcc python g++ pkg-config libz-dev libglib2.0-dev libpixman-1-dev libfdt-dev git libstdc++6 valgrind +COPY . /build/ +WORKDIR /build +ENTRYPOINT ./opal-ci/build-ubuntu-16.04.sh diff --git a/opal-ci/build-centos6.sh b/opal-ci/build-centos6.sh new file mode 100755 index 0000000..25a25f2 --- /dev/null +++ b/opal-ci/build-centos6.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -uo pipefail +set -e + +# We're fairly limited as to what we want to bother to run on CentOS6 +# It's fairly old and some of the things (e.g. build+run qemu) we don't +# want to bother doing. + +export CROSS=/opt/cross/gcc-4.8.0-nolibc/powerpc64-linux/bin/powerpc64-linux- + +MAKE_J=`grep -c processor /proc/cpuinfo` + +make -j${MAKE_J} all +# Disable 'make check' for now, some errors with gcc 4.ancient +#make -j${MAKE_J} check +#(make clean; cd external/gard && CROSS= make -j${MAKE_J}) +#(cd external/pflash; make -j${MAKE_J}) +make clean +SKIBOOT_GCOV=1 make -j${MAKE_J} +#SKIBOOT_GCOV=1 make -j${MAKE_J} check + +make clean +rm -rf builddir +mkdir builddir +make SRC=`pwd` -f ../Makefile -C builddir -j${MAKE_J} +make clean diff --git a/opal-ci/build-fedora24.sh b/opal-ci/build-fedora24.sh new file mode 100755 index 0000000..609ee4a --- /dev/null +++ b/opal-ci/build-fedora24.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -uo pipefail +set -e +set -x + +MAKE_J=`grep -c processor /proc/cpuinfo` +export CROSS=powerpc64-linux-gnu- + +make -j${MAKE_J} all +make -j${MAKE_J} check +(make clean; cd external/gard && CROSS= make -j${MAKE_J}) +(cd external/pflash; make -j${MAKE_J}) +make clean +# Disable GCOV builds on Fedora 24 as toolchain gives us: +# /usr/bin/powerpc64-linux-gnu-ld: section .bss VMA [0000000000200000,000000000024d757] overlaps section .sym_map VMA [000000000019f340,0000000000208e5c] +# (we shoud fix it, but not yet) +#SKIBOOT_GCOV=1 make -j${MAKE_J} +#SKIBOOT_GCOV=1 make -j${MAKE_J} check + +make clean +rm -rf builddir +mkdir builddir +make SRC=`pwd` -f ../Makefile -C builddir -j${MAKE_J} +make clean diff --git a/opal-ci/build-ubuntu-12.04.sh b/opal-ci/build-ubuntu-12.04.sh new file mode 100755 index 0000000..224d305 --- /dev/null +++ b/opal-ci/build-ubuntu-12.04.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -uo pipefail +set -e + +export CROSS=/opt/cross/gcc-4.8.0-nolibc/powerpc64-linux/bin/powerpc64-linux- +export HOSTCC=gcc-4.8 +MAKE_J=`grep -c processor /proc/cpuinfo` + +make -j${MAKE_J} all +(cd opal-ci; ./build-qemu-powernv.sh) +./opal-ci/fetch-debian-jessie-installer.sh +make -j${MAKE_J} check +(make clean; cd external/gard && CROSS= make -j${MAKE_J}) +(cd external/pflash; ./build-all-arch.sh) +make clean +SKIBOOT_GCOV=1 make -j${MAKE_J} +SKIBOOT_GCOV=1 make -j${MAKE_J} check + +make clean +rm -rf builddir +mkdir builddir +make SRC=`pwd` -f ../Makefile -C builddir -j${MAKE_J} +make clean diff --git a/opal-ci/build-ubuntu-16.04.sh b/opal-ci/build-ubuntu-16.04.sh new file mode 100755 index 0000000..8352be8 --- /dev/null +++ b/opal-ci/build-ubuntu-16.04.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -uo pipefail +set -e + +MAKE_J=`grep -c processor /proc/cpuinfo` + +export CROSS=powerpc64le-linux-gnu- + +make -j${MAKE_J} all +(cd opal-ci; ./build-qemu-powernv.sh) +./opal-ci/fetch-debian-jessie-installer.sh +make -j${MAKE_J} check +(make clean; cd external/gard && CROSS= make -j${MAKE_J}) +(cd external/pflash; ./build-all-arch.sh) +make clean +SKIBOOT_GCOV=1 make -j${MAKE_J} +SKIBOOT_GCOV=1 make -j${MAKE_J} check + +make clean +rm -rf builddir +mkdir builddir +make SRC=`pwd` -f ../Makefile -C builddir -j${MAKE_J} +make clean |