.gitのプロジェクトルートに.gitlab-ci.ymlを設置する
- PHPUnitによる単体テスト
- composer installによるビルドテスト
.gitlab-ci.yml
image: php:7.1-alpine
stages:
- build_test
- unit_test
composer:
stage: build_test
image: composer:1.9.0
script:
- cp ./src/.env.example ./src/.env
- cd src
- composer install --prefer-dist --no-progress --ansi
artifacts:
paths:
- src/vendor/
cache:
paths:
- src/vendor/
phpunit:
stage: unit_test
cache:
paths:
- vendor
before_script:
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
script:
- mv .env.example .env
- composer install --prefer-dist --no-progress --ansi
- php artisan key:generate
- vendor/bin/phpunit --bootstrap vendor/autoload.php tests/
dependencies:
- composer



![国内金融機関での活用事例 メモ[NOINDEX]](https://www.yuulinux.tokyo/contents/wp-content/uploads/2018/11/fintech03-150x150.png)


