From: Neal Gompa Date: Thu, 13 Apr 2017 13:07:02 +0000 (-0400) Subject: CI: Rework .gitlab-ci.yml to support a CentOS 7 build X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=438c1f04f5a31edba4cfe66dd57945bf2fe0fc04;p=lugaru.git CI: Rework .gitlab-ci.yml to support a CentOS 7 build Quite a bit of the .gitlab-ci.yml file needed to be reworked so that the commonalities between Fedora and CentOS could be leveraged while allowing us to swap out the differences dynamically. Thus, we can now test commits against the GCC version we use for release builds while continuing to use latest GCC for development builds. As a nice side effect, there are now much fewer invocations of DNF to install all the needed things, so CI builds should be faster! --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 240f5c0..a65f348 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,17 +1,48 @@ image: fedora:latest cache: - key: dnf paths: - /var/cache/dnf + - /var/cache/yum + +variables: + YUMDNF: dnf + EXTRA_REPO_INST_COMMAND: /bin/true + JPEG_PACKAGE: "pkgconfig(libjpeg)" + CMAKE_PACKAGE: "/usr/bin/cmake" + DEPENDENCY_PACKAGES: "pkgconfig(openal) pkgconfig(sdl2) pkgconfig(glu) pkgconfig(libpng) pkgconfig(zlib) pkgconfig(vorbis) pkgconfig(vorbisfile) pkgconfig(ogg)" + COMMON_PACKAGES: "$COMPILER_PACKAGES $CMAKE_PACKAGE make $DEPENDENCY_PACKAGES $JPEG_PACKAGE" before_script: - - dnf --quiet --assumeyes install /usr/bin/cmake "pkgconfig(libjpeg)" "pkgconfig(openal)" "pkgconfig(sdl2)" "pkgconfig(glu)" "pkgconfig(libpng)" "pkgconfig(zlib)" "pkgconfig(vorbis)" "pkgconfig(vorbisfile)" "pkgconfig(ogg)" make + - $EXTRA_REPO_INST_COMMAND + - $YUMDNF --quiet --assumeyes install $COMMON_PACKAGES + +build_oldgcc: + image: centos:7 + variables: + YUMDNF: yum + EXTRA_REPO_INST_COMMAND: "yum --quiet --assumeyes install epel-release" + JPEG_PACKAGE: "libjpeg-devel" + CMAKE_PACKAGE: "/usr/bin/cmake3" + COMPILER_PACKAGES: "gcc gcc-c++" + stage: build + script: + - export CC=gcc; export CXX=g++ + - mkdir -p x86_64-linux-gnu-oldgcc oldgcc-build; cd x86_64-linux-gnu-oldgcc + - cmake3 .. -DCMAKE_INSTALL_PREFIX=/builds/osslugaru/lugaru/oldgcc-build + - make -j4; make install + artifacts: + expire_in: 14d + paths: + - ./oldgcc-build + tags: + - shared build_gcc: stage: build + variables: + COMPILER_PACKAGES: "gcc gcc-c++" script: - - dnf --quiet --assumeyes install gcc gcc-c++ - export CC=gcc; export CXX=g++ - mkdir -p x86_64-linux-gnu-gcc gcc-build; cd x86_64-linux-gnu-gcc - cmake .. -DCMAKE_INSTALL_PREFIX=/builds/osslugaru/lugaru/gcc-build @@ -25,8 +56,9 @@ build_gcc: build_clang: stage: build + variables: + COMPILER_PACKAGES: "clang" script: - - dnf --quiet --assumeyes install clang - export CC=clang; export CXX=clang++ - mkdir -p x86_64-linux-gnu-clang clang-build; cd x86_64-linux-gnu-clang - cmake .. -DCMAKE_INSTALL_PREFIX=/builds/osslugaru/lugaru/clang-build @@ -40,8 +72,10 @@ build_clang: build_mingw32: stage: build + variables: + COMPILER_PACKAGES: "mingw32-gcc mingw32-gcc-c++ mingw32-binutils mingw32-headers" + DEPENDENCY_PACKAGES: "mingw32-libjpeg-turbo mingw32-libpng mingw32-SDL2 mingw32-zlib mingw32-libvorbis mingw32-libogg mingw32-openal-soft" script: - - dnf --quiet --assumeyes install mingw32-gcc mingw32-gcc-c++ mingw32-binutils mingw32-headers mingw32-libjpeg-turbo mingw32-libpng mingw32-SDL2 mingw32-zlib mingw32-libvorbis mingw32-libogg mingw32-openal-soft - export PKG_CONFIG_LIBDIR="/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/share/pkgconfig" - export PATH=/usr/i686-w64-mingw32/bin:$PATH - mkdir -p i686-w64-mingw32 mingw32-build; cd i686-w64-mingw32 @@ -56,8 +90,10 @@ build_mingw32: build_mingw64: stage: build + variables: + COMPILER_PACKAGES: "mingw64-gcc mingw64-gcc-c++ mingw64-binutils mingw64-headers" + DEPENDENCY_PACKAGES: "mingw64-libjpeg-turbo mingw64-libpng mingw64-SDL2 mingw64-zlib mingw64-libvorbis mingw64-libogg mingw64-openal-soft" script: - - dnf --quiet --assumeyes install mingw64-gcc mingw64-gcc-c++ mingw64-binutils mingw64-headers mingw64-libjpeg-turbo mingw64-libpng mingw64-SDL2 mingw64-zlib mingw64-libvorbis mingw64-libogg mingw64-openal-soft - export PKG_CONFIG_LIBDIR="/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/x86_64-w64-mingw32/sys-root/mingw/share/pkgconfig" - export PATH=/usr/x86_64-w64-mingw32/bin:$PATH - mkdir -p x86_64-w64-mingw32 mingw64-build; cd x86_64-w64-mingw32