Continuous integration
Create a new repo in github.com
Prepare tests
- Create a class that test an api call, check the response code
Get dependencies
- Create composer.json file
- Add require-dev for composer
- Add also bin-dir to show how
- Autoload y autoload-dev
- run
composer install
(explain composer.lock)
Run tests
bin/phpunit tests
bin/phpunit tests --bootstrap vendor/autoload.php
Code
- Create a class that call to an api using guzzle or wherever
- composer update (explain why)
- Run the tests until pass
phpunit.xml
- Create the file
phpunit.xml
- Fill it with the bootstrap, colors and the testsuite
- create the file
.gitignore
for vendor and bin folders
- make the first commit
Travis
- Explain what is travis travis-ci.com
- Create file
.travis.yml
with basic configuration to run tests
- Second commit here
- Push changes to github
- Check build passing in travis
Readme badge
- Get the badge from travis
- Create the file
README.md
, add an title and the badge
Coverage
- Create a new branch for this
git checkout -b coverage
- Run the tests with coverage
bin/phpunit --coverage-clover=coverage.clover
- Add the coverage to the
phpunit.xml
Scrutinizer
- Create an account in scrutinizer-ci.com
- Create the file
.scrutinizer.yml
- Add the configuration for coverage
- Commit and push
- Check scrutinizer check and build in the branch
- Create a pull request and check its status
- Add the badge in the README
- Commit and push
- Check the badge in Github and the commit in the pull request
- Add all the configuration for scrutinizer
- Commit and push
- Add scrutinizer badge
- Commit and push
- Check PR and merge it if possible
- Delete not used branch
Links