mercredi 26 juin 2019

Test stage in gitlab-ci not generating artifacts

While using Gitlab-CI I encountered a problem. Running the tests sometimes would return an error, but I couldn't debug it from the console, since Laravel logs everything into a logs folder. I thought I might save those as artifacts.

I tried setting up the tests in the build stage, that would solve it. But that seems wrong to me.

composer:

  stage: build

  script:
      - composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
      - cp .env.example .env
      - php artisan key:generate

  artifacts:

    expire_in: 1 hour

    paths:
      - vendor/
      - .env

  cache:
    key: ${CI_COMMIT_REF_SLUG}-composer

    paths:
      - vendor/

phpunit:

  stage: test

  dependencies:
    - composer

  script:
    - php artisan migrate:fresh --seed
    - phpunit --coverage-text --colors=never

  artifacts:

    expire_in: 1 day

    paths:
      - storage/logs/

Aucun commentaire:

Enregistrer un commentaire