我正在尝试学习管道,我已经建立了一个简单的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/
作曲家缓存仅缓存使用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
应该是cms/content/vendor/bin/phpunit