From 9b9d9e58d08f751a23b67577562e153c20495a49 Mon Sep 17 00:00:00 2001 From: "Oyvind.Gjesdal" <oyvind.gjesdal@uib.no> Date: Mon, 20 Sep 2021 12:08:22 +0200 Subject: [PATCH] Make CI run PHPUnit tests - Uses PHP 7.4 docker image and composer. --- .gitlab-ci.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef077827..cd3154d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,20 +1,36 @@ stages: -- marcus_test +- test +- deploy_to_test + +phpunit: + stage: "test" + image: "php:7.4" + before_script: + - apt-get update -yqq + - apt-get install -y git zip + - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + - composer install + script: + - ./vendor/bin/phpunit + tags: + - spes + cache: + key: $CI_COMMIT_REF_SLUG + paths: + - "vendor/" marcus_test: variables: MARCUS_SERVER: $MARCUS_TEST_SERVER_IPV6 image: oyvindlg/gitlab-ci-library:ansible-cgi - stage: "marcus_test" + stage: "deploy_to_test" before_script: - eval $(ssh-agent -s) - echo $MARCUS_TEST_KEY | base64 --decode | ssh-add - script: - echo "debug" - - ssh -6 -o "StrictHostKeyChecking=no" $MARCUS_USER@$MARCUS_SERVER "cd $MARCUS_HOME && git fetch && git checkout $CI_COMMIT_SHA && composer install --no-dev" + - ssh -6 -o "StrictHostKeyChecking=no" $MARCUS_USER@$MARCUS_SERVER "cd $MARCUS_HOME && git fetch && git checkout $CI_COMMIT_SHA && composer install --no-dev" - ssh -6 -o "StrictHostKeyChecking=no" $MARCUS_USER@$MARCUS_SERVER "cd $ADMIN_HOME && git fetch && git checkout $CI_COMMIT_SHA && composer install --no-dev" - tags: - spes - -- GitLab