-
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.
- Loading branch information
1 parent
382aefc
commit 51b49cd
Showing
17 changed files
with
163 additions
and
108 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "build"] | ||
path = build | ||
url = https://github.com/gesinn-it-pub/docker-compose-ci.git |
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 @@ | ||
<?xml version="1.0"?> | ||
<ruleset> | ||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> | ||
<exclude name="MediaWiki.NamingConventions.ValidGlobalName.allowedPrefix" /> | ||
<exclude name="MediaWiki.Commenting.MissingCovers.MissingCovers" /> | ||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" /> | ||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> | ||
</rule> | ||
<file>.</file> | ||
<arg name="bootstrap" value="./vendor/mediawiki/mediawiki-codesniffer/utils/bootstrap-ci.php"/> | ||
<arg name="extensions" value="php"/> | ||
<arg name="encoding" value="UTF-8"/> | ||
</ruleset> |
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,52 +1,31 @@ | ||
EXTENSION := ConfIDentSkin | ||
|
||
MW_VERSION ?= 1.35 | ||
CHAMELEON_VERSION ?= 4.1.0 | ||
|
||
EXTENSION_FOLDER := /var/www/html/extensions/${EXTENSION} | ||
COVERAGE_FOLDER := ${EXTENSION_FOLDER}/coverage | ||
PWD := $(shell bash -c "pwd -W 2>/dev/null || pwd")# this way it works on Windows and Linux | ||
IMAGE_NAME := confident-skin:test-${MW_VERSION}-${CHAMELEON_VERSION} | ||
DOCKER_RUN := docker run --rm -v ${PWD}/coverage:${COVERAGE_FOLDER} ${IMAGE_NAME} | ||
PHPUNIT := ${DOCKER_RUN} php tests/phpunit/phpunit.php --testdox -c ${EXTENSION_FOLDER} | ||
NPM := docker run --rm -v ${PWD}/coverage:${COVERAGE_FOLDER} -w ${EXTENSION_FOLDER} ${IMAGE_NAME} npm | ||
-include .env-39 | ||
export | ||
|
||
.PHONY: all | ||
all: | ||
# setup for docker-compose-ci build directory | ||
# delete "build" directory to update docker-compose-ci | ||
|
||
.PHONY: ci | ||
ci: build test | ||
ifeq (,$(wildcard ./build/)) | ||
$(shell git submodule update --init --remote) | ||
endif | ||
|
||
.PHONY: ci-coverage | ||
ci-coverage: build test-coverage | ||
|
||
.PHONY: build | ||
build: | ||
docker build --tag ${IMAGE_NAME} \ | ||
--build-arg=MW_VERSION=${MW_VERSION} \ | ||
--build-arg=CHAMELEON_VERSION=${CHAMELEON_VERSION} \ | ||
. | ||
|
||
.PHONY: test | ||
test: phpunit npm-test | ||
EXTENSION := ConfIDentSkin | ||
|
||
.PHONY: test-coverage | ||
test-coverage: phpunit-coverage npm-test-coverage | ||
# docker images | ||
MW_VERSION?=1.35 | ||
PHP_VERSION?=7.4 | ||
DB_TYPE?=sqlite | ||
DB_IMAGE?="" | ||
|
||
.PHONY: phpunit | ||
phpunit: | ||
${PHPUNIT} ${EXTENSION_FOLDER}/tests/phpunit | ||
# extensions | ||
CHAMELEON_VERSION?=4.2.1 | ||
|
||
.PHONY: | ||
phpunit-coverage: | ||
${PHPUNIT} ${EXTENSION_FOLDER}/tests/phpunit \ | ||
--coverage-html ${COVERAGE_FOLDER}/php \ | ||
--coverage-clover ${COVERAGE_FOLDER}/php/coverage.xml | ||
# composer | ||
# Enables "composer update" inside of extension | ||
COMPOSER_EXT?=true | ||
|
||
.PHONY: npm-test | ||
npm-test: | ||
${NPM} run test | ||
# nodejs | ||
# Enables node.js related tests and "npm install" | ||
NODE_JS?=true | ||
|
||
.PHONY: npm-test-coverage | ||
npm-test-coverage: | ||
${NPM} run test-coverage | ||
# check for build dir and git submodule init if it does not exist | ||
include build/Makefile |
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,19 @@ | ||
{ | ||
"require-dev": { | ||
"mediawiki/mediawiki-codesniffer": "^39.0", | ||
"phpstan/phpstan": "^1.7", | ||
"vimeo/psalm": "^4.23" | ||
}, | ||
"scripts": { | ||
"fix": [ "@phpcs-fix" ], | ||
"test": [ "@analyze", "@phpunit" ], | ||
"test-coverage": [ "@analyze", "@phpunit-coverage" ], | ||
"analyze": ["@phpcs", "@phpstan"], | ||
"phpcs": "phpcs -p -s src tests/phpunit", | ||
"phpcs-fix": "phpcbf src tests/phpunit", | ||
"psalm": "psalm --config=psalm.xml", | ||
"psalm-baseline": "psalm --config=psalm.xml --set-baseline=psalm-baseline.xml", | ||
"phpunit": "php ../../tests/phpunit/phpunit.php -c phpunit.xml.dist --testdox", | ||
"phpunit-coverage": "php ../../tests/phpunit/phpunit.php -c phpunit.xml.dist --testdox --coverage-text --coverage-html coverage/php --coverage-clover coverage/php/coverage.xml" | ||
} | ||
} |
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
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
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.