Skip to content

Commit

Permalink
Merge pull request #35 from Sweetchuck/circleci
Browse files Browse the repository at this point in the history
Upgrade CircleCI definition to v2.1
  • Loading branch information
Sweetchuck authored Dec 30, 2019
2 parents de2bf02 + 0b74015 commit 9a550de
Show file tree
Hide file tree
Showing 13 changed files with 1,065 additions and 891 deletions.
152 changes: 152 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@

version: 2.1

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

executors:
php704:
environment:
<<: *env_composer

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

php703:
environment:
<<: *env_composer

docker:
-
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:
name: 'Composer - cache restore'
keys:
- 'composer-{{ checksum "./composer.lock" }}-1'

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


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

test:
description: 'Run tests'
steps:
-
run:
name: 'Codeception - unit'
command: 'bin/robo test unit'
-
run:
name: 'Codeception - acceptance'
command: 'bin/robo test acceptance'
-
store_test_results:
name: 'Store unit test results'
path: './tests/_output/machine/junit'
-
run:
# @todo Use orb.
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
jobs:
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:
lint_and_test:
jobs:
-
build: {}
-
lint:
requires:
- build
-
test_php704:
requires:
- build
-
test_php703:
requires:
- build
-
test_php702:
requires:
- build
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Robo task wrapper for PHP_CodeSniffer

[![Build Status](https://travis-ci.org/Sweetchuck/robo-phpcs.svg?branch=master)](https://travis-ci.org/Sweetchuck/robo-phpcs)
[![CircleCI](https://circleci.com/gh/Sweetchuck/robo-phpcs.svg?style=svg)](https://circleci.com/gh/Sweetchuck/robo-phpcs)
[![codecov](https://codecov.io/gh/Sweetchuck/robo-phpcs/branch/master/graph/badge.svg)](https://codecov.io/gh/Sweetchuck/robo-phpcs)

@todo
Expand Down
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
18 changes: 10 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@
"optimize-autoloader": true
},
"require": {
"php": ">=7.1",
"php": ">=7.2",
"ext-dom": "*",
"ext-json": "*",
"sweetchuck/lint-report": "^0.0",
"consolidation/robo": "^1.0"
"consolidation/robo": "^2.0"
},
"require-dev": {
"codeception/codeception": "^2.2",
"codeception/codeception": "^4.0",
"codeception/module-asserts": "^1.1",
"cweagans/composer-patches": "^1.6",
"mikey179/vfsStream": "^1.6",
"sweetchuck/codeception-module-robo-task-runner": "^0.0",
"sweetchuck/git-hooks": "^0.0",
"sweetchuck/robo-git": "^0.0",
"mikey179/vfsstream": "^1.6",
"squizlabs/php_codesniffer": "^3.0",
"symfony/yaml": "^3.1 || ^4.0",
"sweetchuck/codeception-module-robo-task-runner": "^0.7",
"sweetchuck/git-hooks": "^0.0",
"sweetchuck/robo-git": "^0.2",
"symfony/yaml": "^4.0",
"webmozart/path-util": "^2.3"
},
"autoload": {
Expand Down
Loading

0 comments on commit 9a550de

Please sign in to comment.