CIcircle CINotes
CIcircle CINotes
https://www.youtube.com/watch?v=ymPOI4gWQFY
CI is mostly for huge teams, where multiple monster merges per day are done, CI is
an automated way to do tests and other tasks
circleCI
https://akrabat.com/using-circleci-for-a-php-project/
https://www.youtube.com/watch?v=7VxBn_ZgOek
https://github.com/xperius123/circleci-demo-php-laravel.git
github account to test with: xperius123 / a7xAgdwg
-----------------------------------------------------------------------------------
-------
version: 2
jobs:
build:
working_directory: /var/www/html
docker:
- image: php:7.1-apache
#- image: circleci/php:7.3-stretch-node-browsers
environment:
APP_ENV: test
# build steps
steps:
# cloning the github repo
- checkout
- run:
name: Install system packages
command: apt-get update && apt-get -y install git
- run:
name: Install PHP extensions
command: docker-php-ext-install pdo
- checkout
- run:
name: Install Composer
command: |
php -r "copy('https://getcomposer.org/installer', 'composer-
setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') ===
trim(file_get_contents('https://composer.github.io/installer.sig'))) { echo
'Installer verified'; } else { echo 'Installer invalid'; unlink('composer-
setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
- run:
name: Display PHP information
command: |
php -v
php composer.phar --version
- run:
name: Install project dependencies
command: php composer.phar install
- run:
name: Run CS tests
command: vendor/bin/phpcs
- run:
name: Run Unit tests
command: vendor/bin/phpunit
-----------------------------------------------------------------------------------
-------
To actually get builds to run, you log into CircleCI – usefully you authenticate
via GitHub – and select the project to build. From now on, pushing to GitHub or a
branch will result in the build running