-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now we introduce the `ci` environment, which is the environment where we run the CI tests. It is based on the prd image, although we need the tests folder and dependencies to be able to run the tests. It does not have xdebug installed, as we can use the php builtin debugger to generate the coverage reports.
- Loading branch information
Showing
5 changed files
with
129 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
build: | ||
|
||
environment: | ||
variables: | ||
ENV: 'ci' | ||
mysql: false | ||
postgresql: false | ||
redis: false | ||
rabbitmq: false | ||
php: | ||
version: 7.1 | ||
ini: | ||
'date.timezone': 'Europe/Amsterdam' | ||
docker: | ||
remote_engine: true | ||
cache: | ||
images: | ||
- 'php:7.1-alpine' | ||
- 'hgraca/explicit-architecture:app.sfn.base' | ||
|
||
dependencies: | ||
override: | ||
- true # so scrutinizer does't install the dependencies, which we don't need because they are inside the container | ||
|
||
tests: | ||
override: | ||
- command: make test-ci | ||
coverage: | ||
file: var/coverage.clover.xml | ||
format: php-clover | ||
|
||
filter: | ||
paths: | ||
- "src/" | ||
dependency_paths: | ||
- "vendor/" | ||
|
||
build_failure_conditions: | ||
- 'issues.new.exists' | ||
- 'project.metric_change("scrutinizer.test_coverage", < -0.05)' | ||
|
||
checks: | ||
php: | ||
code_rating: true | ||
duplication: true |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
Symfony Demo Application | ||
======================== | ||
[![Author][Author]](https://www.herbertograca.com) | ||
[![Software License][License]](LICENSE) | ||
|
||
[![Build Status][Build]](https://scrutinizer-ci.com/g/hgraca/explicit-architecture-php/build-status/master) | ||
[![Scrutinizer Code Quality][Score]](https://scrutinizer-ci.com/g/hgraca/explicit-architecture-php/?branch=master) | ||
[![Coverage Status][Coverage]](https://scrutinizer-ci.com/g/hgraca/explicit-architecture-php/code-structure) | ||
|
||
[![Code Intelligence Status][CodeInt]](https://scrutinizer-ci.com/code-intelligence) | ||
|
||
The "Symfony Demo Application" is a reference application created to show how | ||
to develop Symfony applications following the recommended best practices. | ||
|
@@ -77,3 +85,11 @@ Configure the test run itself: | |
|
||
[1]: https://symfony.com/doc/current/reference/requirements.html | ||
[2]: https://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html | ||
|
||
[Author]: http://img.shields.io/badge/[email protected]?style=flat-square | ||
[License]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square | ||
|
||
[Build]: https://scrutinizer-ci.com/g/hgraca/explicit-architecture-php/badges/build.png?b=master | ||
[Score]: https://scrutinizer-ci.com/g/hgraca/explicit-architecture-php/badges/quality-score.png?b=master | ||
[Coverage]: https://img.shields.io/scrutinizer/coverage/g/hgraca/explicit-architecture-php.svg?style=flat-square | ||
[CodeInt]: https://scrutinizer-ci.com/g/hgraca/explicit-architecture-php/badges/code-intelligence.svg?b=master |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM hgraca/explicit-architecture:app.sfn.prd | ||
|
||
ENV ENV="ci" | ||
|
||
COPY ./tests /opt/app/tests | ||
|
||
COPY ./phpunit.xml.dist /opt/app/ | ||
COPY ./.php_cs.dist /opt/app/ | ||
|
||
WORKDIR /opt/app | ||
|
||
RUN make dep-install-ci-guest && \ | ||
chmod -R 777 /opt/app/var && \ | ||
make dep-clearcache-guest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: '3' | ||
|
||
services: | ||
app: | ||
image: hgraca/explicit-architecture:app.sfn.ci | ||
container_name: app.sfn.ci | ||
working_dir: /opt/app | ||
build: | ||
context: ../../../ | ||
dockerfile: ./build/container/ci/app.dockerfile | ||
tty: true # `stty` is required to test CLI commands | ||
environment: | ||
# These env variables are here just so we can run this container locally | ||
# They are different in the CI and in ACC, setup through the CI and PaaS web interfaces | ||
ENV: 'ci' | ||
###> symfony/framework-bundle ### | ||
APP_ENV: 'test' | ||
APP_DEBUG: 0 | ||
APP_SECRET: '67d829bf61dc5f87a73fd814e2c9f629' | ||
###< symfony/framework-bundle ### | ||
###> doctrine/doctrine-bundle ### | ||
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url | ||
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" | ||
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls | ||
DATABASE_URL: 'sqlite:///%kernel.project_dir%/var/data/blog.sqlite' | ||
###< doctrine/doctrine-bundle ### | ||
###> symfony/swiftmailer-bundle ### | ||
# For Gmail as a transport, use: "gmail://username:password@localhost" | ||
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" | ||
# Delivery is disabled by default via "null://localhost" | ||
MAILER_URL: 'null://localhost' | ||
###< symfony/swiftmailer-bundle ### |