Skip to content

Commit

Permalink
Host documentation at ReadTheDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Apr 2, 2017
1 parent 41bf9d7 commit bc8b188
Show file tree
Hide file tree
Showing 16 changed files with 822 additions and 576 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
/vendor/
/bin/
/venv/
/Resources/doc/_build/
composer.lock
38 changes: 15 additions & 23 deletions .travis.yml
Expand Up @@ -4,14 +4,15 @@ branches:
only:
- master

php:
- 5.3
- 5.6
- 7.0
- hhvm
cache:
directories:
- vendor
- venv

env:
- SYMFONY_VERSION=2.8.*
before_install: ./.travis/before_install.php
install: ./.travis/install.php
script: ./.travis/script.php
after_script: ./.travis/after_script.php

matrix:
include:
Expand All @@ -23,29 +24,20 @@ matrix:
- php: 5.3
env: SYMFONY_VERSION=2.8.* # Symfony 3 doesn't support PHP 5.3
- php: 5.6
env: SYMFONY_VERSION=3.1.*
env: SYMFONY_VERSION=3.2.*
# HHVM with and without the Asset component (introduced in 2.7)
- php: hhvm
env: SYMFONY_VERSION=2.3.*
- php: hhvm
env: SYMFONY_VERSION=3.1.*
env: SYMFONY_VERSION=3.2.*
# current PHP with all non-EOLed Symfony versions
- php: 7.0
- php: 7.1
env: SYMFONY_VERSION=2.3.*
- php: 7.0
env: SYMFONY_VERSION=2.7.*
- php: 7.0
- php: 7.1
env: SYMFONY_VERSION=2.8.*
- php: 7.0
env: SYMFONY_VERSION=3.0.*
- php: 7.0
env: SYMFONY_VERSION=3.1.*
- php: 7.0
- php: 7.1
env: SYMFONY_VERSION=3.2.*
- php: 7.1
env: SYMFONY_VERSION=dev-master
allow_failures:
- env: SYMFONY_VERSION=dev-master

before_install: ./.travis/before_install.php
install: ./.travis/install.php
script: ./.travis/script.php
after_script: ./.travis/after_script.php
11 changes: 8 additions & 3 deletions .travis/common.php
@@ -1,8 +1,13 @@
<?php

function shouldBuildDocs()
{
return isLatestPhp() && isLatestSymfony();
}

function withCodeCoverage()
{
return isLatestPhp() && in_array(getSymfonyVersion(), array('2.3.*', '3.1.*'));
return isLatestPhp() && in_array(getSymfonyVersion(), array('2.3.*', '3.2.*'));
}

function isHhvm()
Expand All @@ -12,12 +17,12 @@ function isHhvm()

function isLatestPhp()
{
return getPhpVersion() === '7.0';
return getPhpVersion() === '7.1';
}

function isLatestSymfony()
{
return getSymfonyVersion() === '3.1.*';
return getSymfonyVersion() === '3.2.*';
}

function getSymfonyVersion()
Expand Down
6 changes: 4 additions & 2 deletions .travis/install.php
Expand Up @@ -3,8 +3,6 @@

include_once 'common.php';

runCommand('composer self-update');

if (isLatestPhp() && isLatestSymfony()) {
// Make sure composer.json references all necessary components by having one
// job run a `composer update`. Since `composer update` will install the
Expand All @@ -19,3 +17,7 @@

runCommand('composer require --prefer-dist symfony/symfony:'.getSymfonyVersion());
}

if (shouldBuildDocs()) {
runCommand('export PATH=$HOME/.local/bin:$PATH && pip install -r requirements.txt --user `whoami`');
}
8 changes: 6 additions & 2 deletions .travis/script.php
Expand Up @@ -4,7 +4,11 @@
include_once 'common.php';

if (withCodeCoverage()) {
runCommand('phpunit --coverage-text --coverage-clover coverage.xml');
runCommand('vendor/bin/phpunit --coverage-text --coverage-clover coverage.xml');
} else {
runCommand('phpunit');
runCommand('vendor/bin/phpunit');
}

if (shouldBuildDocs()) {
runCommand('sphinx-build -E -W Resources/doc Resources/doc/_build');
}
43 changes: 43 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,43 @@
# CONTRIBUTING
This bundle is all about Developer Experience so your feedback is **essential** for us, the community, to make it better. Every issue and Pull Request will be treated with respect.

If you decide to use this bundle, please consider opening issues if:

* You had any hiccups while setting it up
* You notice something missing in the documentation
* You see something you think should be done differently
* You notice something missing that you consider would benefit the majority of the users of this bundle
* Whatever else

## Coding Standards
This project follows [Symfony's Coding Standards](http://symfony.com/doc/current/contributing/code/standards.html). Before you submit your PR, make sure to run [PHP-CS-Fixer](http://cs.sensiolabs.org), which will automatically format the code:

php-cs-fixer fix

## Tests
Before submitting your PR, make sure tests pass:

composer install
vendor/bin/phpunit

## Documentation
Documentation is built using [Sphinx](http://www.sphinx-doc.org).

### Setup
Make sure you have [pip installed](https://pip.pypa.io/en/stable/installing/) and then install the needed dependencies inside a [virtualenv](https://virtualenv.pypa.io) environment, in ~order not to pollute your system:

sudo pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

### Building the docs
Build the documentation with:

source venv/bin/activate
sphinx-build -E Resources/doc Resources/doc/_build

Alternatively, use `sphinx-autobuild` to watch changes and automatically refresh the browser:

source venv/bin/activate
sphinx-autobuild -E -B Resources/doc Resources/doc/_build

0 comments on commit bc8b188

Please sign in to comment.