Gitlab CI:./bin/phpunit:没有这样的文件或目录

时间:2019-03-14 11:59:09

标签: symfony phpunit gitlab-ci

我尝试了解如何在带有 PHPUnit 的laravel项目中使用Gitlab CI。正如Laravel的documentation所写,我在 PHPUnit-bridge 中添加了composer require --dev symfony/phpunit-bridge

MY gilab-ci.yml文件

image: php:7.2-cli
services:
    - mysql:latest
cache:
    paths:
    - vendor/

stages:
    - connect
    - test
    - deploy

variables:
    # Configure mysql service (https://hub.docker.com/_/mysql/)
    MYSQL_DATABASE: deshautsdebats
    MYSQL_USER: root
    MYSQL_ROOT_PASSWORD: root
    MYSQL_PASSWORD: root

before_script:
    - apt-get update -yqq
    - apt-get install git -yqq zlib1g-dev
    # Install mysql driver
    - docker-php-ext-install pdo_mysql zip
    # Install composer
    - curl -sS https://getcomposer.org/installer | php
    # Install all project dependencies
    - php composer.phar install

test:
    stage: test
    script:
        - ls -lad bin/
        - ./bin/phpunit

当我在本地输入./bin/phpunit时,它可以工作,但是当CI发出时,如果说:

  

/ bin / bash:第90行:./bin/phpunit:没有此类文件或目录

我尝试将./bin/phpunit替换为./vendor/bin/phpunit,但是它引发了相同的错误...您有任何想法吗?

谢谢

1 个答案:

答案 0 :(得分:0)

我通过遵循those steps

来解决这个问题