Verified Commit 07dab2ea authored by Alexandre Morin's avatar Alexandre Morin
Browse files

Update gitlab ci - unit tests

parent a48c8cbe
Pipeline #3474 failed with stage
in 9 minutes and 34 seconds
#services:
# - docker:dind
services:
- postgres:9.4
stages:
- tests
......@@ -16,6 +16,131 @@ cache:
- cache/Cypress
- node_modules
before_script:
- apt-get update > /dev/null
- mkdir -p /usr/share/man/man1
- mkdir -p /usr/share/man/man7
- apt-get install cron -yqq > /dev/null
- apt-get install libreoffice -yqq > /dev/null
- bash ci/docker_install_php.sh > /dev/null
- bash ci/docker_install_database.sh > /dev/null
unit-tests:php-7.3:
image: php:7.3-apache
stage: tests
script:
- useradd -m -g www-data maarch
- export APACHE_RUN_USER=maarch
- mkdir -p /var/www/html/
- cp -R /builds/maarch/maarchRM/ /var/www/maarchRM/
- mv /var/www/maarchRM/ /var/www/laabs/
- cd /var/www/laabs
- cp data/maarchRM/conf/vhost.conf.default data/maarchRM/conf/vhost.conf
- cp data/maarchRM/conf/configuration.ini.default data/maarchRM/conf/configuration.ini
- cp data/maarchRM/conf/confvars.ini.default data/maarchRM/conf/confvars.ini
- mkdir -p /var/www/laabs/data/maarchRM/repository/archives_1 /var/www/laabs/data/maarchRM/repository/archives_2
- chown -R maarch:www-data /var/www
- chmod -R 775 /var/www
- cd /etc/apache2/sites-available/
- touch maarchRM.conf
- echo "Include /var/www/laabs/data/maarchRM/conf/vhost.conf" >> maarchRM.conf
- a2ensite maarchRM.conf
- a2dissite 000-default.conf
- a2enmod rewrite
- a2enmod env
- service apache2 start
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-7.phar
- chmod +x /usr/local/bin/phpunit
except:
- master
unit-tests:php-7.2:
image: php:7.3-apache
stage: tests
script:
- useradd -m -g www-data maarch
- export APACHE_RUN_USER=maarch
- mkdir -p /var/www/html/
- cp -R /builds/maarch/maarchRM/ /var/www/maarchRM/
- mv /var/www/maarchRM/ /var/www/laabs/
- cd /var/www/laabs
- cp data/maarchRM/conf/vhost.conf.default data/maarchRM/conf/vhost.conf
- cp data/maarchRM/conf/configuration.ini.default data/maarchRM/conf/configuration.ini
- cp data/maarchRM/conf/confvars.ini.default data/maarchRM/conf/confvars.ini
- mkdir -p /var/www/laabs/data/maarchRM/repository/archives_1 /var/www/laabs/data/maarchRM/repository/archives_2
- chown -R maarch:www-data /var/www
- chmod -R 775 /var/www
- cd /etc/apache2/sites-available/
- touch maarchRM.conf
- echo "Include /var/www/laabs/data/maarchRM/conf/vhost.conf" >> maarchRM.conf
- a2ensite maarchRM.conf
- a2dissite 000-default.conf
- a2enmod rewrite
- a2enmod env
- service apache2 start
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-7.phar
- chmod +x /usr/local/bin/phpunit
except:
- master
unit-tests:php-7.1:
image: php:7.3-apache
stage: tests
script:
- useradd -m -g www-data maarch
- export APACHE_RUN_USER=maarch
- mkdir -p /var/www/html/
- cp -R /builds/maarch/maarchRM/ /var/www/maarchRM/
- mv /var/www/maarchRM/ /var/www/laabs/
- cd /var/www/laabs
- cp data/maarchRM/conf/vhost.conf.default data/maarchRM/conf/vhost.conf
- cp data/maarchRM/conf/configuration.ini.default data/maarchRM/conf/configuration.ini
- cp data/maarchRM/conf/confvars.ini.default data/maarchRM/conf/confvars.ini
- mkdir -p /var/www/laabs/data/maarchRM/repository/archives_1 /var/www/laabs/data/maarchRM/repository/archives_2
- chown -R maarch:www-data /var/www
- chmod -R 775 /var/www
- cd /etc/apache2/sites-available/
- touch maarchRM.conf
- echo "Include /var/www/laabs/data/maarchRM/conf/vhost.conf" >> maarchRM.conf
- a2ensite maarchRM.conf
- a2dissite 000-default.conf
- a2enmod rewrite
- a2enmod env
- service apache2 start
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-7.phar
- chmod +x /usr/local/bin/phpunit
except:
- master
unit-tests:php-7.0:
image: php:7.3-apache
stage: tests
script:
- useradd -m -g www-data maarch
- export APACHE_RUN_USER=maarch
- mkdir -p /var/www/html/
- cp -R /builds/maarch/maarchRM/ /var/www/maarchRM/
- mv /var/www/maarchRM/ /var/www/laabs/
- cd /var/www/laabs
- cp data/maarchRM/conf/vhost.conf.default data/maarchRM/conf/vhost.conf
- cp data/maarchRM/conf/configuration.ini.default data/maarchRM/conf/configuration.ini
- cp data/maarchRM/conf/confvars.ini.default data/maarchRM/conf/confvars.ini
- mkdir -p /var/www/laabs/data/maarchRM/repository/archives_1 /var/www/laabs/data/maarchRM/repository/archives_2
- chown -R maarch:www-data /var/www
- chmod -R 775 /var/www
- cd /etc/apache2/sites-available/
- touch maarchRM.conf
- echo "Include /var/www/laabs/data/maarchRM/conf/vhost.conf" >> maarchRM.conf
- a2ensite maarchRM.conf
- a2dissite 000-default.conf
- a2enmod rewrite
- a2enmod env
- service apache2 start
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-7.phar
- chmod +x /usr/local/bin/phpunit
except:
- master
functional-test:cypress:
image: cypress/base:10
stage: tests
......@@ -25,6 +150,7 @@ functional-test:cypress:
- $(npm bin)/cypress run
only:
- schedules
- develop
artifacts:
expire_in: 1 week
when: always
......@@ -32,31 +158,38 @@ functional-test:cypress:
- cypress/screenshots
- cypress/videos
php-metrics:
syntax-test:php-metrics:
image: jakzal/phpqa
stage: tests
script: phpmetrics --report-html=var/php-metrics src
except:
- schedules
artifacts:
paths:
- var/php-metrics/
allow_failure: true
php-phpmd:
syntax-test:php-phpmd:
image: jakzal/phpqa
stage: tests
script:
- mkdir var/
- phpmd src html phpmd.xml --reportfile var/phpmd.html --ignore-violations-on-exit
except:
- schedules
artifacts:
paths:
- var/phpmd.html
allow_failure: true
php-deprecation-detector:
syntax-test:php-deprecation-detector:
image: jakzal/phpqa
stage: tests
script:
- deprecation-detector check src vendor/
except:
- schedules
allow_failure: true
......@@ -65,6 +198,7 @@ php-deprecation-detector:
# script:
# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# - docker build dockerfile/version/ -t "$CI_REGISTRY_IMAGE"
# - docker tag "$CI_REGISTRY_IMAGE"
# - docker push "$CI_REGISTRY_IMAGE"
# only:
# - feat/gitlab_ci
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment