douyin8813 2016-08-12 18:52
浏览 55
已采纳

如何使用Laravel 5设置travis-ci? InvalidArgumentException

I tried to run Travis-ci with Laravel 5.2 several times, but nothing works for me. I can run phpunit locally and it works, but not in travis.

My current travis.yml:

language: php

php:
  - 5.5
  - 5.6
  - 7.0
  #- hhvm
  #- nightly

sudo: required

before_script:
  - mkdir bootstrap/cache
  - mkdir storage
  - mkdir storage/framework
  - mkdir storage/framework/cache
  - sudo chmod -R 777 bootstrap/cache
  - sudo chmod -R 777 storage
  #- cp .env.travis .env
  - composer self-update
  - composer install --no-interaction
  #- php artisan key:generate

script:
  - vendor/bin/phpunit

The latest error in travis is a failed request to [http://localhost]. Received status code [500]. Caused by exception 'InvalidArgumentException' with message 'Please provide a valid cache path.' in /home/travis/build/Saibamen/laravel5-travis/bootstrap/cache/compiled.php:15392

All commits and travis logs are here: click

  • 写回答

2条回答 默认 最新

  • dongwen9975 2016-09-18 14:07
    关注

    Correct travis file is:

    language: php
    
    php:
      - 5.6
      - 7.0
    
    before_script:
      - mkdir bootstrap/cache
      - mkdir storage
      - mkdir storage/app
      - mkdir storage/framework
      - mkdir storage/framework/sessions
      - mkdir storage/framework/cache
      - mkdir storage/framework/views
      - chmod 777 -R storage
      - cp .env.travis .env
      - mysql -e 'create database homestead_test;'
      - composer self-update
      - composer install --no-interaction
      - php artisan key:generate
    
    script:
      - vendor/bin/phpunit
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动