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

Commit 1852ca9

Browse files
authored
Merge pull request #49 from codacy/circleci-build
clean: Move build to CircleCI
2 parents e3377d4 + 44d0ef2 commit 1852ca9

File tree

6 files changed

+97
-56
lines changed

6 files changed

+97
-56
lines changed

.circleci/config.yml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
version: 2.1
2+
3+
orbs:
4+
codacy: codacy/base@1.2.1
5+
6+
references:
7+
default_php_job: &default_php_job
8+
docker:
9+
- image: circleci/php:7.4-node-browsers
10+
working_directory: ~/workdir
11+
workspace_attach: &workspace_attach
12+
attach_workspace:
13+
at: ~/
14+
workspace_persist: &workspace_persist
15+
persist_to_workspace:
16+
paths:
17+
- workdir/*
18+
root: ~/
19+
cache_restore: &cache_restore
20+
restore_cache:
21+
keys:
22+
- composer-v1-{{ checksum "composer.lock" }}
23+
- composer-v1-
24+
cache_save: &cache_save
25+
save_cache:
26+
key: composer-v1-{{ checksum "composer.lock" }}
27+
paths:
28+
- vendor
29+
30+
jobs:
31+
test:
32+
<<: *default_php_job
33+
steps:
34+
- *workspace_attach
35+
- *cache_restore
36+
- run:
37+
command: composer install
38+
- *cache_save
39+
- run:
40+
command: composer test
41+
- *workspace_persist
42+
publish:
43+
<<: *default_php_job
44+
steps:
45+
- *workspace_attach
46+
- run:
47+
command: |
48+
composer codacyCoverage
49+
composer build
50+
- *workspace_persist
51+
publish_circleci_artifacts:
52+
machine: true
53+
working_directory: ~/workdir
54+
steps:
55+
- *workspace_attach
56+
- store_artifacts:
57+
path: ~/workdir/artifacts/
58+
59+
workflows:
60+
version: 2
61+
compile_test_deploy:
62+
jobs:
63+
- codacy/checkout_and_version
64+
- test:
65+
requires:
66+
- codacy/checkout_and_version
67+
- publish:
68+
requires:
69+
- test
70+
filters:
71+
branches:
72+
only:
73+
- master
74+
- publish_circleci_artifacts:
75+
requires:
76+
- publish
77+
- codacy/publish_ghr:
78+
path: ~/workdir/artifacts/
79+
requires:
80+
- publish_circleci_artifacts
81+
- codacy/tag_version:
82+
name: tag_version
83+
context: CodacyAWS
84+
requires:
85+
- codacy/publish_ghr

.travis.yml

-17
This file was deleted.

box.json

-9
This file was deleted.

circle.yml

-26
This file was deleted.

composer.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@
99
"symfony/console": "~2.5|~3.0|~4.0|~5.0"
1010
},
1111
"require-dev": {
12-
"phpunit/phpunit": "~6.5"
12+
"phpunit/phpunit": "~6.5",
13+
"clue/phar-composer": "^1.1"
1314
},
14-
"bin": ["bin/codacycoverage"],
15+
"scripts": {
16+
"test": "php vendor/bin/phpunit --coverage-clover build/coverage/xml tests",
17+
"codacyCoverage": "php bin/codacycoverage clover build/coverage/xml",
18+
"build": "mkdir -p artifacts && php -d phar.readonly=off ./vendor/bin/phar-composer build . artifacts/codacy-coverage.phar"
19+
},
20+
"bin": [
21+
"bin/codacycoverage"
22+
],
1523
"autoload": {
1624
"classmap": [
1725
"src/"

src/Codacy/Coverage/Command/Clover.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7070
if ($output->isVerbose()) {
7171
$output->writeln($result);
7272
}
73-
73+
7474
return 0;
7575
}
7676

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

0 commit comments

Comments
 (0)