-
-
Save Stetzon/6a12083b9dc52694433855178dc29496 to your computer and use it in GitHub Desktop.
Running phpunit tests and caching composer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: php:7.3-fpm | |
definitions: | |
caches: | |
composer-custom: /composer/cache | |
services: | |
mysql: | |
image: mysql:8.0 | |
environment: | |
MYSQL_DATABASE: 'homestead' | |
MYSQL_RANDOM_ROOT_PASSWORD: 'yes' | |
MYSQL_USER: 'homestead' | |
MYSQL_PASSWORD: 'secret' | |
steps: | |
- step: &install-composer-packages | |
name: Composer install | |
caches: | |
- composer-custom | |
script: | |
- apt-get update && apt-get install -qy git curl unzip | |
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | |
- composer install --no-progress --no-scripts | |
artifacts: | |
- vendor/** | |
.scripts: | |
- &setup-tests | | |
apt-get update && apt-get install -qy libmcrypt-dev default-mysql-client | |
yes | pecl install mcrypt-1.0.2 | |
echo "memory_limit = 256M" > $PHP_INI_DIR/conf.d/php-memory-limits.ini | |
cp .env.pipelines .env | |
php artisan key:generate | |
pipelines: | |
pull-requests: | |
'**': | |
- step: *install-composer-packages | |
- parallel: | |
- step: | |
name: Unit | |
script: | |
- *setup-tests | |
- vendor/bin/phpunit tests/Unit --testdox | |
services: | |
- mysql | |
- step: | |
name: Feature | |
script: | |
- *setup-tests | |
- vendor/bin/phpunit tests/Feature --testdox | |
services: | |
- mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment