Browse Source

add gitlab CI conf

Olivier Massot 4 years ago
parent
commit
a58b552b7f
1 changed files with 30 additions and 0 deletions
  1. 30 0
      .gitlab-ci.yml

+ 30 - 0
.gitlab-ci.yml

@@ -0,0 +1,30 @@
+stages:
+  - test
+
+before_script:
+  - curl -sS https://composer.github.io/installer.sig > installer.sig
+  - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
+  - php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
+  - php composer-setup.php
+  - php -r "unlink('composer-setup.php'); unlink('installer.sig');"
+
+cache:
+  paths:
+    - ./vendor
+
+unit:otcore:
+  stage: test
+
+  script:
+    - php composer.phar --quiet --no-interaction install
+    - ./bin/phpunit -c ./Tests/Build/UnitTests.xml --coverage-text --colors=never
+
+  artifacts:
+    paths:
+      - ./coverage/
+    when: always
+    reports:
+      junit: ./coverage/junit-report.xml
+
+  coverage: '/^\s*Lines:\s*\d+.\d+\%/'
+