Skip to content

Commit

Permalink
Add CircleCI build (#39)
Browse files Browse the repository at this point in the history
* Run phpunit on circleci

* Update phpro/grumphp to ^0.14

Also update erusev/parsedown to ^1.7 as ^1.6 had a XSS vulnerability
(see erusev/parsedown#495).

This allows dependencies to be installed successfully on CircleCI.

* Disable all library hooks besides curl for tests
  • Loading branch information
tusbar authored and Daniel15 committed Mar 6, 2018
1 parent 9320664 commit 5dea22e
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 36 deletions.
77 changes: 77 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
version: 2

defaults:
workspace_root: &workspace_root
~/BuildSize

php_container: &php_container
working_directory: *workspace_root
docker:
- image: circleci/php:7.2

attach_workspace: &attach_workspace
attach_workspace:
at: *workspace_root

restore_composer: &restore_composer
restore_cache:
name: Restore composer cache
keys:
- v1-composer-{{ checksum "composer.lock" }}
- v1-composer-

jobs:
checkout:
<<: *php_container
steps:
- checkout

- persist_to_workspace:
root: *workspace_root
paths:
- ./

composer:
<<: *php_container
steps:
- *attach_workspace
- *restore_composer

- run:
name: Install dependencies
command: composer install --no-interaction

- save_cache:
name: Save composer cache
key: v1-composer-{{ checksum "composer.lock" }}
paths:
- vendor

test:
<<: *php_container
steps:
- *attach_workspace
- *restore_composer

- run:
name: Run PHP tests
command: ./vendor/bin/phpunit --log-junit reports/phpunit/junit.xml

- store_test_results:
path: reports/phpunit


workflows:
version: 2

push:
jobs:
- checkout

- composer:
requires:
- checkout

- test:
requires:
- composer
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/public/storage
/storage/*.key
/vendor
/reports
/.idea
/.vagrant
Homestead.json
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"require": {
"php": ">=7.0.0",
"doctrine/dbal": "^2.6",
"erusev/parsedown": "^1.6",
"erusev/parsedown": "^1.7",
"fideloper/proxy": "~3.3",
"firebase/php-jwt": "^5.0",
"graham-campbell/github": "^6.0",
Expand All @@ -27,7 +27,7 @@
"mockery/mockery": "0.9.*",
"php-vcr/php-vcr": "^1.3",
"php-vcr/phpunit-testlistener-vcr": "^3.0",
"phpro/grumphp": "^0.12.0",
"phpro/grumphp": "^0.14.0",
"phpunit/phpunit": "6.2",
"sebastian/phpcpd": "^3.0",
"sensiolabs/security-checker": "^4.1"
Expand Down
73 changes: 39 additions & 34 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

require(__DIR__ . '/../vendor/autoload.php');
\VCR\VCR::configure()->enableLibraryHooks(array('curl'));
\VCR\VCR::turnOn();
\VCR\VCR::configure()
->setCassettePath(__DIR__ . '/fixtures/http/')
Expand Down

0 comments on commit 5dea22e

Please sign in to comment.