Skip to content

Commit

Permalink
circleci: add circleci
Browse files Browse the repository at this point in the history
- Add CircleCI configuration
- Remove pre-commit hook validation
- Explicit requires php_codesniffer
  • Loading branch information
dudu committed Jul 2, 2018
1 parent 9bfbda3 commit d46d84d
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 9 deletions.
67 changes: 67 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: 2
workflows:
version: 2
test:
jobs:
- test-5.4
- test-5.5
- test-5.6
- test-7.0
- test-7.1
- test-7.2

jobs:
test-5.6: &test-template
docker:
- image: php:5.6-alpine

working_directory: ~/repo

steps:
- checkout
- run:
name: Install composer
command: |
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
- run:
name: Install Dependencies
command: composer install -n --prefer-dist

- run:
name: Code Sniffer
command: |
vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
vendor/bin/phpcs lib/ --standard=PSR2
vendor/bin/phpcs tests/ --standard=PSR2
- run:
name: Unit tests
command: vendor/bin/phpunit

- run:
name: E2E tests
command: vendor/bin/behat

test-7.0:
<<: *test-template
docker:
- image: php:7.0-alpine
test-7.1:
<<: *test-template
docker:
- image: php:7.1-alpine
test-7.2:
<<: *test-template
docker:
- image: php:7.2-alpine
#Legacy versions
test-5.4:
<<: *test-template
docker:
- image: devilbox/php-fpm:5.4-mods
test-5.5:
<<: *test-template
docker:
- image: devilbox/php-fpm:5.5-mods
11 changes: 2 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
"repositories" : [
{
"type" : "vcs",
"url" : "https://github.com/pagarme/git-hooks.git"
}
],
"name": "pagarme/pagarme-php",
"description": "Pagar.Me PHP Library",
"type": "lib",
Expand All @@ -25,11 +19,10 @@
"require-dev": {
"ext-mbstring": "*",
"phpunit/phpunit": "^4.8",
"pagarme/git-hooks": "dev-master",
"behat/mink-extension": "^2.2"
"behat/mink-extension": "^2.2",
"squizlabs/php_codesniffer": "^3.3"
},
"scripts": {
"post-update-cmd": "bash vendor/pagarme/git-hooks/phpcs-pre-commit/install.sh",
"test": [
"@composer install",
"vendor/bin/phpunit"
Expand Down

0 comments on commit d46d84d

Please sign in to comment.