Skip to content

Commit

Permalink
Merge pull request #4 from Sweetchuck/upgrade-dependencies
Browse files Browse the repository at this point in the history
Upgrade dependencies
  • Loading branch information
Sweetchuck committed Feb 23, 2020
2 parents 191fe04 + c89239d commit 9fb5525
Show file tree
Hide file tree
Showing 16 changed files with 1,691 additions and 1,292 deletions.
227 changes: 132 additions & 95 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,117 +1,154 @@

version: 2

_custom:
step__run__install_php_extensions: &step__run__install_php_extensions
name: 'Install PHP extensions'
command: |
sudo apt-get -y install zlib1g-dev
sudo docker-php-ext-install zip
step__run__install_composer: &step__run__install_composer
name: 'Install composer'
command: |
cd /tmp
EXPECTED_SIGNATURE=$(curl -q https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi
sudo php composer-setup.php --quiet --install-dir /usr/local/bin --filename composer
RESULT=$?
rm composer-setup.php
exit $RESULT
step__restore_cache: &step__restore_cache
name: 'Cache restore - "./vendor"'
keys:
- 'v1-dependencies-{{ checksum "composer.lock" }}'
- 'v1-dependencies-'
step__run__composer_install: &step__run__composer_install
name: 'Build'
command: 'composer install --no-interaction'
step__save_cache: &step__save_cache
name: 'Cache save - "./vendor"'
paths:
- './vendor'
key: 'v1-dependencies-{{ checksum "composer.lock" }}'
step__run__linters: &step__run__linters
name: 'Run linters'
command: 'bin/robo lint'
step__run__codeception_unit: &step__run__codeception_unit
name: 'Codeception - unit'
command: 'bin/robo test unit'
step__run__codeception_acceptance: &step__run__codeception_acceptance
name: 'Codeception - acceptance'
command: 'bin/robo test acceptance'
step__store_test_results: &step__store_test_results
path: 'tests/_output/machine/junit'
step__run__codecov: &step__run__codecov
name: 'Publish the code coverage report on Codecov.io'
when: 'always'
command: >
[ ! -s tests/_output/machine/coverage/*/coverage.xml ]
|| bash <(curl -s https://codecov.io/bash)
|| true
job__lint_and_test: &job__lint_and_test
working_directory: '~/repo'
steps:
- 'checkout'
version: 2.1

.env_composer: &env_composer
COMPOSER_NO_INTERACTION: '1'
COMPOSER_MEMORY_LIMIT: '-1'
COMPOSER_DISABLE_XDEBUG_WARN: '1'

orbs:
codecov: codecov/codecov@1.0.5

executors:
php704:
environment:
<<: *env_composer

docker:
-
run:
<<: *step__run__install_php_extensions
name: 'main'
image: 'circleci/php:7.4'

php703:
environment:
<<: *env_composer

docker:
-
run:
<<: *step__run__install_composer
name: 'main'
image: 'circleci/php:7.3'

php702:
environment:
<<: *env_composer

docker:
-
name: 'main'
image: 'circleci/php:7.2'

commands:
composer_install:
description: 'Install Composer dependencies with cache restore and save'
steps:
-
restore_cache:
<<: *step__restore_cache
name: 'Composer - cache restore'
keys:
- 'composer-{{ checksum "./composer.lock" }}-1'

-
run:
<<: *step__run__composer_install
name: 'Composer - install'
command: >
[[ -d "$(composer config vendor-dir)" ]] || composer install --no-progress
-
save_cache:
<<: *step__save_cache
name: 'Composer - cache save'
key: 'composer-{{ checksum "./composer.lock" }}-1'
paths:
- './bin/'
- './vendor/'
- '~/.composer/cache/'


lint:
description: 'Run linters'
steps:
-
run:
<<: *step__run__linters
name: 'Run linters'
command: 'bin/robo lint'

test:
description: 'Run tests'
steps:
-
run:
<<: *step__run__codeception_unit
name: 'Codeception - unit'
command: 'bin/robo test unit'
-
codecov/upload:
flags: 'unit'
file: './tests/_output/machine/coverage/unit/coverage.xml'
-
run:
<<: *step__run__codeception_acceptance
name: 'Codeception - acceptance'
command: 'bin/robo test acceptance'
-
store_test_results:
<<: *step__store_test_results
codecov/upload:
flags: 'acceptance'
file: './tests/_output/machine/coverage/acceptance/coverage.xml'
-
run:
<<: *step__run__codecov
store_test_results:
name: 'Store unit test results'
path: './tests/_output/machine/junit'

jobs:
php701__lint_and_test:
<<: *job__lint_and_test
docker:
-
image: 'circleci/php:7.1'
php702__lint_and_test:
<<: *job__lint_and_test
docker:
-
image: 'circleci/php:7.2'
build:
executor: 'php702'
working_directory: '~/repo'
steps:
- 'checkout'
- 'composer_install'
lint:
executor: 'php702'
working_directory: '~/repo'
steps:
- 'checkout'
- 'composer_install'
- 'lint'
test_php704:
executor: 'php704'
working_directory: '~/repo'
steps:
- 'checkout'
- 'composer_install'
- 'test'
test_php703:
executor: 'php703'
working_directory: '~/repo'
steps:
- 'checkout'
- 'composer_install'
- 'test'
test_php702:
executor: 'php702'
working_directory: '~/repo'
steps:
- 'checkout'
- 'composer_install'
- 'test'

workflows:
version: 2
php701__lint_and_test:
lint_and_test:
jobs:
- 'php701__lint_and_test'
php702__lint_and_test:
jobs:
- 'php702__lint_and_test'
-
build: {}
-
lint:
requires:
- build
-
test_php704:
requires:
- build
-
test_php703:
requires:
- build
-
test_php702:
requires:
- build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/tests/_support/_generated/

/.git-hooks.local
/RoboFileLocal.php
2 changes: 1 addition & 1 deletion codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ paths:
support: tests/_support
envs: tests/_envs

bootstrap: _bootstrap.php
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 1024M

Expand Down
32 changes: 25 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,43 @@
"name": "sweetchuck/robo-php-lint",
"description": "Template to create a new Robo task.",
"license": "GPL-2.0-or-later",
"keywords": [
"robo-tasks",
"php-lint"
],
"authors": [
{
"name": "Dávid Andor",
"role": "Maintainer",
"homepage": "https://github.com/Sweetchuck"
}
],
"homepage": "https://github.com/Sweetchuck/robo-php-lint",
"support": {
"source": "https://github.com/Sweetchuck/robo-php-lint",
"issues": "https://github.com/Sweetchuck/robo-php-lint/issues"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"bin-dir": "bin",
"sort-packages": true
},
"require": {
"php": ">=7.1",
"php": ">=7.2",
"ext-pcre": "*",
"consolidation/robo": "^1.0",
"sweetchuck/cli-cmd-builder": "^0.0"
"consolidation/robo": "^2.0",
"sweetchuck/utils": "^0.1.0"
},
"require-dev": {
"codeception/codeception": "^2.2",
"codeception/codeception": "^4.0",
"codeception/module-asserts": "^1.1",
"danielstjules/stringy": "^3.0",
"sweetchuck/codeception-module-robo-task-runner": "^0.4",
"squizlabs/php_codesniffer": "^3.5",
"sweetchuck/codeception-module-robo-task-runner": "^0.7",
"sweetchuck/git-hooks": "^0.0",
"sweetchuck/robo-git": "^0.0",
"sweetchuck/robo-phpcs": "^0.0",
"sweetchuck/robo-git": "^0.2",
"sweetchuck/robo-phpcs": "^0.1",
"webmozart/path-util": "^2.3"
},
"autoload": {
Expand Down
Loading

0 comments on commit 9fb5525

Please sign in to comment.