Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #49 from codacy/circleci-build
Browse files Browse the repository at this point in the history
clean: Move build to CircleCI
  • Loading branch information
lolgab authored Jan 10, 2020
2 parents e3377d4 + 44d0ef2 commit 1852ca9
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 56 deletions.
85 changes: 85 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
version: 2.1

orbs:
codacy: codacy/base@1.2.1

references:
default_php_job: &default_php_job
docker:
- image: circleci/php:7.4-node-browsers
working_directory: ~/workdir
workspace_attach: &workspace_attach
attach_workspace:
at: ~/
workspace_persist: &workspace_persist
persist_to_workspace:
paths:
- workdir/*
root: ~/
cache_restore: &cache_restore
restore_cache:
keys:
- composer-v1-{{ checksum "composer.lock" }}
- composer-v1-
cache_save: &cache_save
save_cache:
key: composer-v1-{{ checksum "composer.lock" }}
paths:
- vendor

jobs:
test:
<<: *default_php_job
steps:
- *workspace_attach
- *cache_restore
- run:
command: composer install
- *cache_save
- run:
command: composer test
- *workspace_persist
publish:
<<: *default_php_job
steps:
- *workspace_attach
- run:
command: |
composer codacyCoverage
composer build
- *workspace_persist
publish_circleci_artifacts:
machine: true
working_directory: ~/workdir
steps:
- *workspace_attach
- store_artifacts:
path: ~/workdir/artifacts/

workflows:
version: 2
compile_test_deploy:
jobs:
- codacy/checkout_and_version
- test:
requires:
- codacy/checkout_and_version
- publish:
requires:
- test
filters:
branches:
only:
- master
- publish_circleci_artifacts:
requires:
- publish
- codacy/publish_ghr:
path: ~/workdir/artifacts/
requires:
- publish_circleci_artifacts
- codacy/tag_version:
name: tag_version
context: CodacyAWS
requires:
- codacy/publish_ghr
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

9 changes: 0 additions & 9 deletions box.json

This file was deleted.

26 changes: 0 additions & 26 deletions circle.yml

This file was deleted.

12 changes: 10 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
"symfony/console": "~2.5|~3.0|~4.0|~5.0"
},
"require-dev": {
"phpunit/phpunit": "~6.5"
"phpunit/phpunit": "~6.5",
"clue/phar-composer": "^1.1"
},
"bin": ["bin/codacycoverage"],
"scripts": {
"test": "php vendor/bin/phpunit --coverage-clover build/coverage/xml tests",
"codacyCoverage": "php bin/codacycoverage clover build/coverage/xml",
"build": "mkdir -p artifacts && php -d phar.readonly=off ./vendor/bin/phar-composer build . artifacts/codacy-coverage.phar"
},
"bin": [
"bin/codacycoverage"
],
"autoload": {
"classmap": [
"src/"
Expand Down
4 changes: 2 additions & 2 deletions src/Codacy/Coverage/Command/Clover.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($output->isVerbose()) {
$output->writeln($result);
}

return 0;
}

Expand Down Expand Up @@ -102,7 +102,7 @@ protected function getProjectToken()
if ($projectToken == false) {
throw new \InvalidArgumentException(
"Cannot continue with execution as long as your project token is not set as an environmental variable."
. PHP_EOL . "Please type: export CODACY_PROJECT_TOKEN=<YOUR TOKEN>"
. PHP_EOL . "Please type: export CODACY_PROJECT_TOKEN=<YOUR TOKEN>"
);
}

Expand Down

0 comments on commit 1852ca9

Please sign in to comment.