summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@codelibre.net>2017-11-22 22:22:47 +0000
committerRoger Leigh <rleigh@codelibre.net>2017-11-22 22:57:48 +0000
commit1ac42d5f93f9dfacff6e3294196d409c068e4c69 (patch)
treed940fc1829af6040783ea7374f5c46a6bad12ad7
parent38ec4dd0744075ade3d5cd49d62db6ecda1daa7f (diff)
downloadlibtiff-git-1ac42d5f93f9dfacff6e3294196d409c068e4c69.tar.gz
Add gitlab-ci build support
-rw-r--r--.gitlab-ci.yml21
-rw-r--r--build/gitlab-ci56
2 files changed, 77 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..fbb7724e
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,21 @@
+image: ubuntu:16.04
+before_script:
+ - apt-get update -qq && apt-get install -y -qq autoconf automake build-essential cmake libtool libjpeg8-dev libjbig-dev liblzma-dev ninja-build zlib1g-dev
+
+stages:
+ - build
+
+autoconf:
+ stage: build
+ script:
+ - sh build/gitlab-ci autoconf
+
+cmake-makefiles:
+ stage: build
+ script:
+ - sh build/gitlab-ci cmake "Unix Makefiles" Release
+
+cmake-ninja:
+ stage: build
+ script:
+ - sh build/gitlab-ci cmake "Ninja" Debug
diff --git a/build/gitlab-ci b/build/gitlab-ci
new file mode 100644
index 00000000..25b3b92f
--- /dev/null
+++ b/build/gitlab-ci
@@ -0,0 +1,56 @@
+#!/bin/sh
+# This script is used for testing the build, primarily for use
+# with travis, but may be used by hand as well.
+
+set -e
+set -x
+
+# Test autoconf build
+autoconf_build()
+{
+ autoreconf -ivf
+
+ mkdir autoconf-build
+ cd autoconf-build
+ echo "Running ../configure --prefix=$(pwd)/../autoconf-install) ${opts}"
+ ../configure --prefix=$(pwd)/../autoconf-install ${opts}
+ make
+ make install
+ make check
+}
+
+# Test autoconf build
+cmake_build()
+{
+ PATH="$(pwd)/tools/bin:$PATH"
+ if [ "$(uname -s)" = "Darwin" ]; then
+ PATH="$(pwd)/tools/CMake.app/Contents/bin:$PATH"
+ fi
+ mkdir cmake-build
+ cd cmake-build
+ echo "Running cmake -G "$1" -DCMAKE_BUILD_TYPE="$2" -DCMAKE_INSTALL_PREFIX=../autoconf-install ${opts} .."
+ cmake -G "$1" -DCMAKE_BUILD_TYPE="$2" -DCMAKE_INSTALL_PREFIX=../autoconf-install ${opts} ..
+ cmake --build .
+ cmake --build . --target install
+ ctest -V
+}
+
+build=$1
+shift
+
+case $build in
+ autoconf)
+ echo "Testing Autoconf build"
+ autoconf_build "$@"
+ ;;
+ cmake)
+ echo "Testing CMake build"
+ cmake_build "$@"
+ ;;
+ *)
+ echo "Invalid argument: \"$arg\"" >&2
+ exit 1
+ ;;
+esac
+
+exit 0