diff options
author | 2018-10-07 10:59:59 +0200 | |
---|---|---|
committer | 2019-04-19 15:30:41 +0200 | |
commit | 3138d45219ebf21f9ebde374cea803d3b0ef3f32 (patch) | |
tree | 5fed5759e3526c9ff63fb58748fa1199bd385982 | |
parent | c48be591595df4820d330724ee56393f9feba4ff (diff) | |
download | paludis-3138d45219ebf21f9ebde374cea803d3b0ef3f32.tar.gz paludis-3138d45219ebf21f9ebde374cea803d3b0ef3f32.tar.xz |
Improve CI setup
16 files changed, 339 insertions, 14 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67a7cb538..abcfa28b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,56 @@ -image: exherbo/exherbo_ci +stages: + - build + - test -before_script: - - chgrp tty /dev/tty - - cave resolve -1x repository/media repository/python repository/scientific repository/x11 - - echo "dev-lang/python:2.7 sqlite" >> /etc/paludis/options.conf - - cave resolve -x dev-cpp/gtest dev-db/sqlite dev-libs/boost dev-libs/jansson dev-python/Sphinx dev-ruby/syntax --permit-old-version sphinxcontrib-websupport --skip-phase test > /dev/null +.build-template: &build-template + stage: build + image: paludis/${DISTRIBUTION}-${COMPILER}:${VERSION} + script: + - mkdir -pv build-obj && cd build-obj + - ../ci/configure-paludis.sh .. ${DISTRIBUTION} ${COMPILER} + - ninja -j$(nproc) all + cache: &build_artifact_cache + key: build-${DISTRIBUTION}-${COMPILER}-${VERSION} + paths: + - build-obj/ + +.test-template: &test-template + stage: test + image: paludis/${DISTRIBUTION}-${COMPILER}:${VERSION} + cache: *build_artifact_cache + script: + - cd build-obj + - ctest -V + +build:exherbo: + variables: + DISTRIBUTION: "exherbo" + COMPILER: "gcc" + VERSION: "latest" + <<: *build-template + +test:exherbo: + variables: + DISTRIBUTION: "exherbo" + COMPILER: "gcc" + VERSION: "latest" + dependencies: + - build:exherbo + <<: *test-template + +build:gentoo: + variables: + DISTRIBUTION: "gentoo" + COMPILER: "gcc" + VERSION: "latest" + <<: *build-template + +test:gentoo: + variables: + DISTRIBUTION: "gentoo" + COMPILER: "gcc" + VERSION: "latest" + dependencies: + - build:gentoo + <<: *test-template -build: - script: - - mkdir build - - cd build - - cmake -DCMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES:PATH='/usr/x86_64-pc-linux-gnu/include;/usr/host/include' -DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES:PATH='/usr/x86_64-pc-linux-gnu/include;/usr/host/include' -DENABLE_GTEST:BOOL=TRUE -DENABLE_PBINS:BOOL=TRUE -DENABLE_PYTHON:BOOL=TRUE -DENABLE_RUBY:BOOL=TRUE -DENABLE_SEARCH_INDEX:BOOL=TRUE -DENABLE_VIM:BOOL=TRUE -DENABLE_XML:BOOL=TRUE -DPALUDIS_CLIENTS=cave -DPALUDIS_ENVIRONMENTS="default;test" -DPALUDIS_REPOSITORIES="default;accounts;gemcutter;repository" -DPALUDIS_DEFAULT_DISTRIBUTION=exherbo -DCONFIG_FRAMEWORK=eclectic .. - - make -j$(nproc) - - make ARGS="--verbose" test - - make install DESTDIR=../install diff --git a/ci/configure-paludis.sh b/ci/configure-paludis.sh new file mode 100755 index 000000000..c7d122dde --- /dev/null +++ b/ci/configure-paludis.sh @@ -0,0 +1,94 @@ +CMAKE_SOURCE=${1} +DISTRIBUTION=${2} +COMPILER=${3} +BUILD_TYPE=${4:-debug} + +myconf=() +if [[ ${DISTRIBUTION} == "exherbo" ]]; then + myconf+=( + -DPALUDIS_ENVIRONMENTS="default;test" + -DPALUDIS_REPOSITORIES="default;accounts;gemcutter;repository" + -DPALUDIS_DEFAULT_DISTRIBUTION=exherbo + -DCONFIG_FRAMEWORK=eclectic + + -DRUBY_VERSION:STRING="2.4" + ) +elif [[ ${DISTRIBUTION} == "gentoo" ]]; then + myconf+=( + -DPALUDIS_ENVIRONMENTS="default;test" + -DPALUDIS_REPOSITORIES="default" + -DPALUDIS_DEFAULT_DISTRIBUTION=gentoo + -DCONFIG_FRAMEWORK=eselect + + -DRUBY_VERSION:STRING="2.4" + ) +fi + +if [[ ${COMPILER} == gcc ]]; then + CC=gcc + CXX=g++ +elif [[ ${COMPILER} == gcc8 ]]; then + CC=gcc-8 + CXX=g++-8 +elif [[ ${COMPILER} == gcc7 ]]; then + CC=gcc-7 + CXX=g++-7 +elif [[ ${COMPILER} == clang ]]; then + CC=clang + CXX="clang++" +else + echo "Unknown compiler '${COMPILER}', exiting" + exit 1 +fi + +if [[ ${BUILD_TYPE} == "release" ]]; then + CMAKE_BUILD_TYPE="Release" + CXXFLAGS="-pipe -O2" + LDFLAGS="" +elif [[ ${BUILD_TYPE} == "debug" ]]; then + CMAKE_BUILD_TYPE="Debug" + CXXFLAGS="-pipe -O0 -pedantic -g3" + LDFLAGS="" +elif [[ ${3} == "coverage" ]]; then + CMAKE_BUILD_TYPE="Debug" + CXXFLAGS="${CXXFLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage" + LDFLAGS="${LDFLAGS} --coverage" +else + echo "Error: Unknown build type '${BUILD_TYPE}' specified. Exiting." + exit 1 +fi + +cmake \ + -G Ninja \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} \ + -DCMAKE_C_FLAGS:STRING="${CFLAGS}" \ + -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS}" \ + -DCMAKE_EXE_LINKER_FLAGS:STRING="${LDFLAGS}" \ + -DCMAKE_AR:PATH=x86_64-pc-linux-gnu-ar \ + -DCMAKE_RANLIB:PATH=x86_64-pc-linux-gnu-ranlib \ + -DCMAKE_NM:PATH=x86_64-pc-linux-gnu-nm \ + -DCMAKE_C_COMPILER:PATH=${CC} \ + -DCMAKE_CXX_COMPILER:PATH=${CXX} \ + -DCMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES:PATH='/usr/x86_64-pc-linux-gnu/include;/usr/host/include' \ + -DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES:PATH='/usr/x86_64-pc-linux-gnu/include;/usr/host/include' \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr/x86_64-pc-linux-gnu \ + -DCMAKE_SYSTEM_PREFIX_PATH:PATH=/usr/x86_64-pc-linux-gnu \ + -DCMAKE_INSTALL_LIBDIR:STRING=lib \ + -DCMAKE_INSTALL_DATAROOTDIR:PATH=/usr/share/ \ + -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc \ + -DCMAKE_INSTALL_DOCDIR:PATH=/usr/share/doc/paludis-scm \ + -DPALUDIS_VIM_INSTALL_DIR=/usr/share/vim/vimfiles \ + -DPALUDIS_CLIENTS=cave \ + -DENABLE_GTEST:BOOL=TRUE \ + -DENABLE_DOXYGEN:BOOL=TRUE \ + -DENABLE_PBINS:BOOL=TRUE \ + -DENABLE_PYTHON:BOOL=TRUE \ + -DENABLE_PYTHON_DOCS:BOOL=TRUE \ + -DENABLE_RUBY:BOOL=TRUE \ + -DENABLE_RUBY_DOCS:BOOL=TRUE \ + -DENABLE_SEARCH_INDEX:BOOL=TRUE \ + -DENABLE_VIM:BOOL=TRUE \ + -DENABLE_XML:BOOL=TRUE \ + "${myconf[@]}" \ + ${CMAKE_SOURCE} diff --git a/ci/docker/exherbo/paludis-exherbo-gcc/Dockerfile b/ci/docker/exherbo/paludis-exherbo-gcc/Dockerfile new file mode 100644 index 000000000..fadf75684 --- /dev/null +++ b/ci/docker/exherbo/paludis-exherbo-gcc/Dockerfile @@ -0,0 +1,29 @@ +FROM exherbo/exherbo-x86_64-pc-linux-gnu-base:latest +MAINTAINER Marvin Schmidt <marv@exherbo.org> + +# Switch to option.conf.d layout +RUN rm /etc/paludis/options.conf \ + && mkdir /etc/paludis/options.conf.d + +COPY ./config/options/* /etc/paludis/options.conf.d/ +COPY ./config/sets/paludis-deps.conf /etc/paludis/sets/ + +RUN chgrp tty /dev/tty \ + && eclectic env update \ + && source /etc/profile \ + && cave resolve -1z repository/{media,pyro,python,scientific,x11} -x \ + && cave resolve -1z -Ks -ks -x \ + -o dev-python/sphinxcontrib-websupport \ + --recommendations ignore \ + --suggestions ignore \ + paludis-deps + +# Clean up +RUN rm -fr \ + /var/log/paludis* \ + /var/cache/paludis/distfiles/* \ + /var/tmp/paludis/build/* + +# Add non-privileged user +RUN useradd -M builder +USER builder diff --git a/ci/docker/exherbo/paludis-exherbo-gcc/build.sh b/ci/docker/exherbo/paludis-exherbo-gcc/build.sh new file mode 100755 index 000000000..9a81212be --- /dev/null +++ b/ci/docker/exherbo/paludis-exherbo-gcc/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# vim: set sw=4 sts=4 ts=4 et tw=80 : + +docker build \ + --no-cache \ + --rm \ + --pull \ + --tag paludis/exherbo-gcc \ + . diff --git a/ci/docker/exherbo/paludis-exherbo-gcc/config/options/00_build_options.conf b/ci/docker/exherbo/paludis-exherbo-gcc/config/options/00_build_options.conf new file mode 100644 index 000000000..123f628b2 --- /dev/null +++ b/ci/docker/exherbo/paludis-exherbo-gcc/config/options/00_build_options.conf @@ -0,0 +1 @@ +*/* BUILD_OPTIONS: jobs=2 diff --git a/ci/docker/exherbo/paludis-exherbo-gcc/config/options/01_target_i686-pc-linux-gnu.conf b/ci/docker/exherbo/paludis-exherbo-gcc/config/options/01_target_i686-pc-linux-gnu.conf new file mode 100644 index 000000000..4a00e6127 --- /dev/null +++ b/ci/docker/exherbo/paludis-exherbo-gcc/config/options/01_target_i686-pc-linux-gnu.conf @@ -0,0 +1 @@ +*/* TARGETS: i686-pc-linux-gnu diff --git a/ci/docker/exherbo/paludis-exherbo-gcc/config/options/01_target_x86_64-pc-linux-gnu.conf b/ci/docker/exherbo/paludis-exherbo-gcc/config/options/01_target_x86_64-pc-linux-gnu.conf new file mode 100644 index 000000000..fc2e8ee63 --- /dev/null +++ b/ci/docker/exherbo/paludis-exherbo-gcc/config/options/01_target_x86_64-pc-linux-gnu.conf @@ -0,0 +1 @@ +*/* TARGETS: x86_64-pc-linux-gnu diff --git a/ci/docker/exherbo/paludis-exherbo-gcc/config/options/10_paludis.conf b/ci/docker/exherbo/paludis-exherbo-gcc/config/options/10_paludis.conf new file mode 100644 index 000000000..3eca4d8eb --- /dev/null +++ b/ci/docker/exherbo/paludis-exherbo-gcc/config/options/10_paludis.conf @@ -0,0 +1,50 @@ +*/* BUILD_OPTIONS: -recommended_tests + +dev-lang/python sqlite + +dev-libs/boost python PYTHON_ABIS: 2.7 + +dev-python/Babel PYTHON_ABIS: 2.7 +dev-python/Cython PYTHON_ABIS: 2.7 +dev-python/Jinja2 PYTHON_ABIS: 2.7 +dev-python/MarkupSafe PYTHON_ABIS: 2.7 +dev-python/Pygments PYTHON_ABIS: 2.7 +dev-python/Sphinx PYTHON_ABIS: 2.7 +dev-python/alabaster PYTHON_ABIS: 2.7 +dev-python/asn1crypto PYTHON_ABIS: 2.7 +dev-python/atomicwrites PYTHON_ABIS: 2.7 +dev-python/attrs PYTHON_ABIS: 2.7 +dev-python/certifi PYTHON_ABIS: 2.7 +dev-python/cffi PYTHON_ABIS: 2.7 +dev-python/chardet PYTHON_ABIS: 2.7 +dev-python/coverage PYTHON_ABIS: 2.7 +dev-python/cryptography PYTHON_ABIS: 2.7 +dev-python/docutils PYTHON_ABIS: 2.7 +dev-python/enum34 PYTHON_ABIS: 2.7 +dev-python/funcsigs PYTHON_ABIS: 2.7 +dev-python/hypothesis PYTHON_ABIS: 2.7 +dev-python/idna PYTHON_ABIS: 2.7 +dev-python/imagesize PYTHON_ABIS: 2.7 +dev-python/ipaddress PYTHON_ABIS: 2.7 +dev-python/more-itertools PYTHON_ABIS: 2.7 +dev-python/numpy PYTHON_ABIS: 2.7 +dev-python/packaging PYTHON_ABIS: 2.7 +dev-python/pathlib2 PYTHON_ABIS: 2.7 +dev-python/pluggy PYTHON_ABIS: 2.7 +dev-python/py PYTHON_ABIS: 2.7 +dev-python/pycparser PYTHON_ABIS: 2.7 +dev-python/pyopenssl PYTHON_ABIS: 2.7 +dev-python/pyparsing PYTHON_ABIS: 2.7 +dev-python/pytest PYTHON_ABIS: 2.7 +dev-python/pytest-runner PYTHON_ABIS: 2.7 +dev-python/pytz PYTHON_ABIS: 2.7 +dev-python/requests PYTHON_ABIS: 2.7 +dev-python/scandir PYTHON_ABIS: 2.7 +dev-python/setuptools PYTHON_ABIS: 2.7 +dev-python/setuptools_scm PYTHON_ABIS: 2.7 +dev-python/six PYTHON_ABIS: 2.7 +dev-python/snowballstemmer PYTHON_ABIS: 2.7 +dev-python/sphinxcontrib-websupport PYTHON_ABIS: 2.7 +dev-python/typing PYTHON_ABIS: 2.7 +dev-python/urllib3 PYTHON_ABIS: 2.7 +dev-python/zopeinterface PYTHON_ABIS: 2.7 diff --git a/ci/docker/exherbo/paludis-exherbo-gcc/config/sets/paludis-deps.conf b/ci/docker/exherbo/paludis-exherbo-gcc/config/sets/paludis-deps.conf new file mode 100644 index 000000000..c3868b000 --- /dev/null +++ b/ci/docker/exherbo/paludis-exherbo-gcc/config/sets/paludis-deps.conf @@ -0,0 +1,30 @@ +# System +* app-shells/bash + +# Documentation +* app-doc/asciidoc +* app-doc/doxygen +* app-text/tidy +* app-text/xmlto +* dev-python/Sphinx +* dev-ruby/syntax + +# Tests +* dev-cpp/gtest + +# Bindings +* dev-libs/boost +* dev-lang/python:2.7 +* dev-lang/ruby:2.5 + +# Search index +* dev-db/sqlite:3 + +# XML things +* dev-libs/libxml2:2.0 + +# Pbins +* app-arch/libarchive + +# gemcutter +* dev-libs/jansson diff --git a/ci/docker/gentoo/paludis-gentoo/Dockerfile b/ci/docker/gentoo/paludis-gentoo/Dockerfile new file mode 100644 index 000000000..fa08311d8 --- /dev/null +++ b/ci/docker/gentoo/paludis-gentoo/Dockerfile @@ -0,0 +1,18 @@ +FROM gentoo/portage:latest as portage +FROM gentoo/stage3-amd64:latest + +# copy the entire portage volume in +COPY --from=portage /usr/portage /usr/portage + +COPY ./config/package.use /etc/portage/ +COPY ./config/package.mask /etc/portage/ +COPY ./config/package.accept_keywords /etc/portage/ +COPY ./config/sets/paludis-deps /etc/portage/sets/ + +RUN emerge --update --newuse --deep -v @world \ + && emerge --update --newuse --deep -v @paludis-deps \ + && rm -rf /usr/portage/* + +# Unprivileged user +RUN useradd -M builder +USER builder diff --git a/ci/docker/gentoo/paludis-gentoo/build.sh b/ci/docker/gentoo/paludis-gentoo/build.sh new file mode 100755 index 000000000..ef7ba5072 --- /dev/null +++ b/ci/docker/gentoo/paludis-gentoo/build.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# vim: set sw=4 sts=4 ts=4 et tw=80 : + +docker build --no-cache --rm --pull -t paludis/gentoo-gcc . diff --git a/ci/docker/gentoo/paludis-gentoo/config/package.accept_keywords b/ci/docker/gentoo/paludis-gentoo/config/package.accept_keywords new file mode 100644 index 000000000..a0be4ae36 --- /dev/null +++ b/ci/docker/gentoo/paludis-gentoo/config/package.accept_keywords @@ -0,0 +1,14 @@ +# required by app-crypt/rhash-1.3.5::gentoo[ssl,-libressl] +# required by dev-util/cmake-3.9.6::gentoo +# required by media-libs/openjpeg-2.3.0::gentoo +# required by app-text/ghostscript-gpl-9.21::gentoo +# required by app-doc/doxygen-1.8.14-r1::gentoo +# required by @selected +# required by @world (argument) +=dev-libs/openssl-1.0.2o-r6 ~amd64 + +# required by dev-libs/boost-1.66.0::gentoo +# required by =dev-libs/boost-1.66.0 (argument) +=dev-util/boost-build-1.66.0 ** +# required by =dev-libs/boost-1.66.0 (argument) +=dev-libs/boost-1.66.0 ** diff --git a/ci/docker/gentoo/paludis-gentoo/config/package.mask b/ci/docker/gentoo/paludis-gentoo/config/package.mask new file mode 100644 index 000000000..1e5cf13ad --- /dev/null +++ b/ci/docker/gentoo/paludis-gentoo/config/package.mask @@ -0,0 +1 @@ +>=dev-libs/boost-1.65 diff --git a/ci/docker/gentoo/paludis-gentoo/config/package.use b/ci/docker/gentoo/paludis-gentoo/config/package.use new file mode 100644 index 000000000..1e70c7608 --- /dev/null +++ b/ci/docker/gentoo/paludis-gentoo/config/package.use @@ -0,0 +1,9 @@ +# required by dev-python/sqlalchemy-1.2.7::gentoo[python_targets_python3_5] +# required by dev-python/sphinxcontrib-websupport-1.0.1-r1::gentoo +# required by dev-python/sphinx-1.6.5::gentoo[-test] +# required by dev-python/sphinx (argument) +dev-lang/python sqlite + +dev-libs/boost python + +*/* -ruby_targets_ruby23 ruby_targets_ruby24 diff --git a/ci/docker/gentoo/paludis-gentoo/config/sets/paludis-deps b/ci/docker/gentoo/paludis-gentoo/config/sets/paludis-deps new file mode 100644 index 000000000..4cc72ae03 --- /dev/null +++ b/ci/docker/gentoo/paludis-gentoo/config/sets/paludis-deps @@ -0,0 +1,17 @@ +app-doc/doxygen +app-text/asciidoc +app-text/htmltidy +app-text/xmlto +dev-python/sphinx +dev-ruby/syntax + +dev-cpp/gtest + +dev-libs/boost +dev-lang/ruby:2.4 + +app-arch/libarchive + +dev-db/sqlite:3 + +dev-util/ninja diff --git a/ci/docker/update-images.sh b/ci/docker/update-images.sh new file mode 100755 index 000000000..c7fca8310 --- /dev/null +++ b/ci/docker/update-images.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# vim: set sw=4 sts=4 ts=4 et tw=80 : + +docker build -t paludis/exherbo-gcc exherbo/paludis-exherbo-gcc + +docker build -t paludis/gentoo-gcc gentoo/paludis-gentoo-gcc + |