Skip to content

Instantly share code, notes, and snippets.

@roelofjan-elsinga
Created December 10, 2019 12:46
Show Gist options
  • Select an option

  • Save roelofjan-elsinga/bbbd503e6b2e012a5153b45fed4f4821 to your computer and use it in GitHub Desktop.

Select an option

Save roelofjan-elsinga/bbbd503e6b2e012a5153b45fed4f4821 to your computer and use it in GitHub Desktop.
Circle CI configuration
version: 2
jobs:
Test-PHP:
machine:
image: ubuntu-1604:201903-01
working_directory: ~/my-project
steps:
- checkout
- restore_cache:
keys:
- my-project-composer-dep-{{ checksum "composer.lock" }}
- run:
name: Starting docker-compose services
command: |
echo "Starting docker-compose"
docker-compose -f docker-compose-ci.yml up -d
- run:
name: Install Composer dependencies
command: |
mv .env.testing.example .env.testing
docker run --rm \
-u $(id -u):$(id -g) \
-v `pwd`:`pwd` -w `pwd` \
--network=$(docker network ls | grep front | awk '{print $2}') \
roelofjanelsinga/test-suite \
composer install
docker run --rm \
-u $(id -u):$(id -g) \
-v `pwd`:`pwd` -w `pwd` \
--network=$(docker network ls | grep front | awk '{print $2}') \
roelofjanelsinga/test-suite \
php artisan key:generate
- save_cache:
key: my-project-composer-dep-{{ checksum "composer.lock" }}
paths:
- ~/my-project/vendor
- run:
name: Run PHPUnit tests
command: |
docker run --rm \
-u $(id -u):$(id -g) \
-v `pwd`:`pwd` -w `pwd` \
--network=$(docker network ls | grep front | awk '{print $2}') \
roelofjanelsinga/test-suite \
./vendor/bin/phpunit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment