Skip to content
Snippets Groups Projects

Resolve "Make gitlab run PHPunit tests"

Merged Oyvind.Gjesdal requested to merge 16-make-gitlab-run-phpunit-tests into master
1 file
+ 21
21
Compare changes
  • Side-by-side
  • Inline
+ 21
21
stages:
stages:
- unit_tests
- test
- marcus_test
- deploy_to_test
marcus_test:
variables:
MARCUS_SERVER: $MARCUS_TEST_SERVER_IPV6
image: oyvindlg/gitlab-ci-library:ansible-cgi
stage: "marcus_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 $ADMIN_HOME && git fetch && git checkout $CI_COMMIT_SHA && composer install --no-dev"
tags:
- spes
unit_tests:
phpunit:
stage: "unit_tests"
stage: "test"
image: "php:7.4"
image: "php:7.4"
before_script:
before_script:
- apt-get update -yqq
- apt-get update -yqq
@@ -27,10 +11,26 @@ unit_tests:
@@ -27,10 +11,26 @@ unit_tests:
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- composer install
script:
script:
- ./vendor/bin/phpunit tests/*.php
- ./vendor/bin/phpunit
tags:
tags:
- spes
- spes
cache:
cache:
key: $CI_COMMIT_REF_SLUG
key: $CI_COMMIT_REF_SLUG
paths:
paths:
- "vendor/"
- "vendor/"
 
 
marcus_test:
 
variables:
 
MARCUS_SERVER: $MARCUS_TEST_SERVER_IPV6
 
image: oyvindlg/gitlab-ci-library:ansible-cgi
 
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 $ADMIN_HOME && git fetch && git checkout $CI_COMMIT_SHA && composer install --no-dev"
 
tags:
 
- spes
Loading