noeldiaz

I forget where I found this sample script that someone placed as a Gist, but I have used a variant on this on my steps to start using the CI component of Gitlab (just got manual install migrated to Omnibus last week). So far just doing phpunit tests and it is working wonderfully. But here is the full script I got online:

before_script:
    - composer install --prefer-dist > /dev/null
    - export APP_ENV=testing

unitTesting:
    script:
        - echo "Running PHP Unit tet"
        - php vendor/bin/phpunit --colors --debug --coverage-text
codeSniffer:
    script:
        - php vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
        - php vendor/bin/phpcs --standard=PSR2 --ignore=app/views,app/storage,app/tests,app/filters.php,app/routes.php,packages/,app/Providers/,app/Console/,app/services/,http/Middleware/,app/Exceptions/,app/Events/ -w --colors app/
    allow_failure: true

phpMess:
    script:
        - php vendor/bin/phpmd app/ text cleancode,controversial,codesize,design,naming,unusedcode --exclude=app/views,app/storage,app/tests,app/filters.php,app/routes.php,packages/,app/Providers/,app/Console/,app/services/,http/Middleware/,app/Exceptions/,app/Events/
    allow_failure: true

Return to Thread...