-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from owncloud/improve_ci
Improve ci
- Loading branch information
Showing
16 changed files
with
340 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
.idea/ | ||
tests/output | ||
tests/output | ||
vendor/ | ||
vendor-bin/**/vendor | ||
vendor-bin/**/composer.lock | ||
.php_cs.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
$config = new OC\CodingStandard\Config(); | ||
$config | ||
->setUsingCache(true) | ||
->getFinder() | ||
->exclude('templates') | ||
->exclude('vendor') | ||
->exclude('vendor-bin') | ||
->in(__DIR__); | ||
return $config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,85 @@ | ||
SHELL := /bin/bash | ||
|
||
COMPOSER_BIN := $(shell command -v composer 2> /dev/null) | ||
ifndef COMPOSER_BIN | ||
$(error composer is not available on your system, please install composer) | ||
endif | ||
|
||
# app definitions | ||
app_name=$(notdir $(CURDIR)) | ||
project_directory=$(CURDIR)/../$(app_name) | ||
|
||
occ=$(CURDIR)/../../occ | ||
|
||
|
||
|
||
# bin file definitions | ||
PHPUNIT=php -d zend.enable_gc=0 ../../lib/composer/bin/phpunit | ||
PHPUNITDBG=phpdbg -qrr -d memory_limit=4096M -d zend.enable_gc=0 "../../lib/composer/bin/phpunit" | ||
PHP_CS_FIXER=php -d zend.enable_gc=0 vendor-bin/owncloud-codestyle/vendor/bin/php-cs-fixer | ||
PHPLINT=php -d zend.enable_gc=0 ../../lib/composer/bin/parallel-lint | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
help: | ||
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | ||
|
||
|
||
|
||
## | ||
## Tests | ||
##-------------------------------------- | ||
|
||
.PHONY: test-php-unit | ||
test-php-unit: ## Run php unit tests | ||
test-php-unit: | ||
$(PHPUNIT) --configuration ./tests/unit/phpunit.xml | ||
|
||
.PHONY: test-php-unit-dbg | ||
test-php-unit-dbg: ## Run php unit tests using phpdbg | ||
test-php-unit-dbg: | ||
$(PHPUNITDBG) --configuration ./tests/unit/phpunit.xml | ||
|
||
.PHONY: test-php-codecheck | ||
test-php-codecheck: ## Run occ app code checks | ||
test-php-codecheck: | ||
$(occ) app:check-code $(app_name) -c private -c strong-comparison | ||
$(occ) app:check-code $(app_name) -c deprecation | ||
|
||
.PHONY: test-php-lint | ||
test-php-lint: ## Run parallel-lint | ||
test-php-lint: | ||
../../lib/composer/bin/parallel-lint . --exclude 3rdparty --exclude build . | ||
$(PHPLINT) . --exclude 3rdparty --exclude build . | ||
|
||
.PHONY: test-php-style | ||
test-php-style: ## Run php-cs-fixer and check owncloud code-style | ||
test-php-style: vendor-bin/owncloud-codestyle/vendor | ||
$(PHP_CS_FIXER) fix -v --diff --diff-format udiff --allow-risky yes --dry-run | ||
|
||
.PHONY: test-php-unit | ||
test-php-unit: | ||
./tests/run-unit.sh | ||
.PHONY: test-php-style-fix | ||
test-php-style-fix: ## Run php-cs-fixer and fix code style issues | ||
test-php-style-fix: vendor-bin/owncloud-codestyle/vendor | ||
$(PHP_CS_FIXER) fix -v --diff --diff-format udiff --allow-risky yes | ||
|
||
## | ||
## Dependency management | ||
##-------------------------------------- | ||
|
||
.PHONY: install-php-deps | ||
install-php-deps: ## Install PHP dependencies | ||
install-php-deps: vendor composer.json composer.lock | ||
|
||
vendor: composer.lock | ||
$(COMPOSER_BIN) install --no-dev | ||
|
||
composer.lock: | ||
$(COMPOSER_BIN) install | ||
|
||
vendor/bamarni/composer-bin-plugin: composer.lock | ||
$(COMPOSER_BIN) install | ||
|
||
vendor-bin/owncloud-codestyle/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/owncloud-codestyle/composer.lock | ||
$(COMPOSER_BIN) bin owncloud-codestyle install --no-progress | ||
|
||
vendor-bin/owncloud-codestyle/composer.lock: vendor-bin/owncloud-codestyle/composer.json | ||
@echo owncloud-codestyle composer.lock is not up to date. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "owncloud/configreport", | ||
"config" : { | ||
"platform": { | ||
"php": "5.6.37" | ||
} | ||
}, | ||
"require": { | ||
}, | ||
"require-dev": { | ||
"bamarni/composer-bin-plugin": "^1.2" | ||
}, | ||
"extra": { | ||
"bamarni-bin": { | ||
"bin-links": false | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.