我正在尝试学习管道,并建立了一个简单的2个步骤。
1.设置作曲器并对其进行缓存
2.建立并测试
请注意,我正在构建一个子文件夹
我没有收到任何错误,但是失败了。 这就是拆机说明:
Searching for test report files in directories named [test-results, failsafe-reports, test-reports, surefire-reports] down to a depth of 4
Finished scanning for test reports. Found 0 test report files.
Merged test suites, total number tests is 0, with 0 failures and 0 errors.
image:
name: php:7.1.1
run-as-user: 1
pipelines:
default:
- step:
name: setup composer
caches:
- composer
script:
- apt-get update && apt-get install -y unzip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- step:
name: build and test
caches:
- composer
script:
- composer global require hirak/prestissimo
- composer install -d cms/content/
- vendor/bin/phpunit
definitions:
caches:
composer: cms/content/
答案 0 :(得分:0)
作曲家仅缓存通过short_open_tag
下载的依赖项,下载的作曲家将始终被删除以进行下一步。最好的方法是将作曲家的操作放在第一步,保存工件(composer install
目录)用于下一步,并在该步骤中测试应用程序。
这看起来像这样:
vendor
注意:我也认为您的image:
name: php:7.1.1
run-as-user: 1
pipelines:
default:
- step:
name: Build
caches:
- composer
script:
- apt-get update && apt-get install -y unzip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer global require hirak/prestissimo
- composer install -d cms/content/
artifacts:
- cms/content/vendor/**
- step:
name: Test
script:
- vendor/bin/phpunit
definitions:
caches:
composer: cms/content/
应该是vendor/bin/phpunit