From 99ad9ecd63264fc65f15293ba6ba1e81b392c07a Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Thu, 22 Jun 2017 21:37:56 -0400 Subject: [PATCH] Add .gitlab-ci.yml --- .gitlab-ci.yml | 8 ++++++++ ci/docker_install.sh | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 ci/docker_install.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..ed0351c8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,8 @@ +image: php:7.0 + +before_script: +- bash ci/docker_install.sh > /dev/null + +test:app: + script: + - phpunit --configuration api/Tests/phpunit.xml \ No newline at end of file diff --git a/ci/docker_install.sh b/ci/docker_install.sh new file mode 100644 index 00000000..1867e970 --- /dev/null +++ b/ci/docker_install.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# We need to install dependencies only for Docker +[[ ! -e /.dockerenv ]] && exit 0 + +set -xe + +# Install git (the php image doesn't have it) which is required by composer +apt-get update -yqq +apt-get install git -yqq + +# Install phpunit, the tool that we will use for testing +curl --location --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar +chmod +x /usr/local/bin/phpunit \ No newline at end of file