-
Notifications
You must be signed in to change notification settings - Fork 1
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 #26 from owncloud/drone-ci
Drone CI
- Loading branch information
Showing
11 changed files
with
1,064 additions
and
131 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
./idea | ||
/build/ | ||
/vendor/ | ||
/vendor/ | ||
composer.lock | ||
vendor-bin/**/vendor | ||
vendor-bin/**/composer.lock | ||
.php-cs-fixer.cache | ||
.phpunit.result.cache | ||
|
||
# drone CI is in .drone.star, do not let someone accidentally commit a local .drone.yml | ||
.drone.yml |
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,13 @@ | ||
<?php | ||
|
||
$config = new OC\CodingStandard\Config(); | ||
|
||
$config | ||
->setUsingCache(true) | ||
->getFinder() | ||
->in(__DIR__) | ||
->exclude('build') | ||
->exclude('vendor-bin') | ||
->exclude('vendor'); | ||
|
||
return $config; |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
SHELL := /bin/bash | ||
|
||
COMPOSER_BIN := $(shell command -v composer 2> /dev/null) | ||
|
||
# bin file definitions | ||
PHPUNIT=php -d zend.enable_gc=0 vendor/bin/phpunit | ||
PHPUNITDBG=phpdbg -qrr -d memory_limit=4096M -d zend.enable_gc=0 vendor/bin/phpunit | ||
PHP_CS_FIXER=php -d zend.enable_gc=0 vendor-bin/owncloud-codestyle/vendor/bin/php-cs-fixer | ||
PHAN=php -d zend.enable_gc=0 vendor-bin/phan/vendor/bin/phan | ||
PHPSTAN=php -d zend.enable_gc=0 vendor-bin/phpstan/vendor/bin/phpstan | ||
|
||
.PHONY: clean | ||
clean: clean-deps | ||
|
||
# Installs and updates the composer dependencies. | ||
.PHONY: composer | ||
composer: | ||
composer install --prefer-dist | ||
composer update --prefer-dist | ||
|
||
##------------ | ||
## Tests | ||
##------------ | ||
|
||
.PHONY: test-php-unit | ||
test-php-unit: ## Run php unit tests | ||
test-php-unit: vendor/bin/phpunit | ||
$(PHPUNIT) --configuration ./phpunit.xml --testsuite TarStreamer | ||
|
||
.PHONY: test-php-unit-dbg | ||
test-php-unit-dbg: ## Run php unit tests using phpdbg | ||
test-php-unit-dbg: vendor/bin/phpunit | ||
$(PHPUNITDBG) --configuration ./phpunit.xml --testsuite TarStreamer | ||
|
||
.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 --allow-risky yes --dry-run | ||
|
||
.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 --allow-risky yes | ||
|
||
.PHONY: test-php-phan | ||
test-php-phan: ## Run phan | ||
test-php-phan: vendor-bin/phan/vendor | ||
$(PHAN) --config-file .phan/config.php --require-config-exists | ||
|
||
.PHONY: test-php-phpstan | ||
test-php-phpstan: ## Run phpstan | ||
test-php-phpstan: vendor-bin/phpstan/vendor | ||
$(PHPSTAN) analyse --memory-limit=4G --configuration=./phpstan.neon --no-progress --level=5 appinfo lib | ||
|
||
.PHONY: clean-deps | ||
clean-deps: | ||
rm -rf ./vendor | ||
rm -Rf vendor-bin/**/vendor vendor-bin/**/composer.lock | ||
|
||
# | ||
# Dependency management | ||
#-------------------------------------- | ||
|
||
composer.lock: composer.json | ||
@echo composer.lock is not up to date. | ||
|
||
vendor: composer.lock | ||
composer install --no-dev | ||
|
||
vendor/bin/phpunit: composer.lock | ||
composer install | ||
|
||
vendor/bamarni/composer-bin-plugin: composer.lock | ||
composer install | ||
|
||
vendor-bin/owncloud-codestyle/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/owncloud-codestyle/composer.lock | ||
composer 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. | ||
|
||
vendor-bin/phan/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/phan/composer.lock | ||
composer bin phan install --no-progress | ||
|
||
vendor-bin/phan/composer.lock: vendor-bin/phan/composer.json | ||
@echo phan composer.lock is not up to date. | ||
|
||
vendor-bin/phpstan/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/phpstan/composer.lock | ||
composer bin phpstan install --no-progress | ||
|
||
vendor-bin/phpstan/composer.lock: vendor-bin/phpstan/composer.json | ||
@echo phpstan 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
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.