diff --git a/.docker/nginx/app.conf b/.docker/nginx/app.conf new file mode 100644 index 0000000..00fc930 --- /dev/null +++ b/.docker/nginx/app.conf @@ -0,0 +1,15 @@ +server { + listen 0.0.0.0:80; + + root /app; + + location / { + try_files $uri $uri/index.php; + } + + location ~ \.php$ { + fastcgi_pass phpfpm:9000; + fastcgi_index index.php; + include fastcgi.conf; + } +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..618eeba --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +sudo: required + +language: php + +php: + - 7.2 + +services: + - docker + +cache: + directories: + - $HOME/.composer/cache + +before_install: + - phpenv config-rm xdebug.ini + - travis_retry composer self-update + - docker-compose -d -f docker-compose.testing.yaml up + +before_script: + - composer install --no-interaction --no-suggest + +script: + - vendor/bin/phpspec run + - vendor/bin/codecept run \ No newline at end of file diff --git a/composer.json b/composer.json index d6ff23f..5ab851b 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,6 @@ "require-dev": { "phpspec/phpspec": "^2.2", "phpunit/phpunit": "4.*", - "codeception/codeception": "2.0.*" + "codeception/codeception": "^2.4" } } diff --git a/docker-compose.testing.yaml b/docker-compose.testing.yaml new file mode 100644 index 0000000..7360ddc --- /dev/null +++ b/docker-compose.testing.yaml @@ -0,0 +1,18 @@ +version: '3' +services: + phpfpm: + tty: true + image: 'bitnami/php-fpm:7.2' + ports: + - 9000:9000 + volumes: + - .:/app + + nginx: + image: 'nginx:alpine' + depends_on: + - phpfpm + ports: + - '8000:80' + volumes: + - ./.docker/nginx/:/etc/nginx/conf.d/