-
Notifications
You must be signed in to change notification settings - Fork 12
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 #15 from gesinn-it-pub/master
Modernizing towards MW 1.37
- Loading branch information
Showing
16 changed files
with
1,137 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
ci: | ||
|
||
runs-on: ubuntu-20.04 | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- mediawiki_version: '1.35' | ||
experimental: false | ||
- mediawiki_version: '1.36' | ||
experimental: true | ||
- mediawiki_version: '1.37' | ||
experimental: true | ||
|
||
env: | ||
MW_VERSION: ${{ matrix.mediawiki_version }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: make ci |
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,4 @@ | ||
vendor | ||
coverage | ||
.phpunit.result.cache | ||
.vscode |
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,17 @@ | ||
<?xml version="1.0"?> | ||
<ruleset> | ||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> | ||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> | ||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" /> | ||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" /> | ||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" /> | ||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" /> | ||
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate" /> | ||
<exclude name="MediaWiki.NamingConventions.ValidGlobalName.allowedPrefix" /> | ||
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" /> | ||
</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
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,15 @@ | ||
ARG MW_VERSION=1.35 | ||
FROM gesinn/docker-mediawiki-sqlite:${MW_VERSION} | ||
|
||
ENV EXTENSION=AutoCreatePage | ||
COPY composer*.json /var/www/html/extensions/$EXTENSION/ | ||
|
||
RUN cd extensions/$EXTENSION && \ | ||
composer update | ||
|
||
COPY . /var/www/html/extensions/$EXTENSION | ||
|
||
RUN sed -i s/80/8080/g /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf && \ | ||
echo \ | ||
"wfLoadExtension( '$EXTENSION' );\n" \ | ||
>> LocalSettings.php |
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,51 @@ | ||
EXTENSION := AutoCreatePage | ||
|
||
MW_VERSION ?= 1.35 | ||
|
||
EXTENSION_FOLDER := /var/www/html/extensions/$(EXTENSION) | ||
IMAGE_NAME := $(shell echo $(EXTENSION) | tr A-Z a-z}):test-$(MW_VERSION) | ||
PWD := $(shell bash -c "pwd -W 2>/dev/null || pwd")# this way it works on Windows and Linux | ||
DOCKER_RUN_ARGS := --rm -v $(PWD)/coverage:$(EXTENSION_FOLDER)/coverage -w $(EXTENSION_FOLDER) $(IMAGE_NAME) | ||
docker_run := docker run $(DOCKER_RUN_ARGS) | ||
|
||
.PHONY: all | ||
all: | ||
|
||
# ======== CI ======== | ||
|
||
.PHONY: ci | ||
ci: build test | ||
|
||
.PHONY: ci-coverage | ||
ci-coverage: build test-coverage | ||
|
||
.PHONY: build | ||
build: | ||
docker build --tag $(IMAGE_NAME) \ | ||
--build-arg=MW_VERSION=$(MW_VERSION) \ | ||
. | ||
|
||
.PHONY: test | ||
test: composer-test | ||
|
||
.PHONY: test-coverage | ||
test-coverage: composer-test-coverage | ||
|
||
.PHONY: composer-test | ||
composer-test: | ||
$(docker_run) composer test | ||
|
||
.PHONY: composer-test-coverage | ||
composer-test-coverage: | ||
$(docker_run) composer test-coverage | ||
|
||
.PHONY: bash | ||
bash: | ||
docker run -it -v $(PWD):/src $(DOCKER_RUN_ARGS) bash | ||
|
||
.PHONY: dev-bash | ||
dev-bash: | ||
docker run -it --rm -p 8080:8080 \ | ||
-v $(PWD):$(EXTENSION_FOLDER) \ | ||
-v $(EXTENSION_FOLDER)/vendor/ \ | ||
-w $(EXTENSION_FOLDER) $(IMAGE_NAME) bash -c 'service apache2 start && bash' |
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,30 @@ | ||
{ | ||
"require-dev": { | ||
"mediawiki/mediawiki-codesniffer": "39.0.0", | ||
"php-parallel-lint/php-console-highlighter": "1.0.0", | ||
"php-parallel-lint/php-parallel-lint": "1.3.2", | ||
"phpstan/phpstan": "^1.7" | ||
}, | ||
"scripts": { | ||
"test": [ | ||
"@analyze", | ||
"@phpunit" | ||
], | ||
"test-coverage": [ | ||
"@analyze", | ||
"@phpunit-coverage" | ||
], | ||
"analyze": [ | ||
"@lint", | ||
"@phpcs", | ||
"@phpstan" | ||
], | ||
"lint": "parallel-lint . --exclude vendor", | ||
"phpcs": "phpcs -p -s .", | ||
"phpcs-fix": "phpcbf .", | ||
"phpstan": "phpstan analyse --configuration=phpstan.neon --memory-limit=2G", | ||
"phpstan-baseline": "phpstan analyse --configuration=phpstan.neon --memory-limit=2G --generate-baseline", | ||
"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" | ||
} | ||
} |
Oops, something went wrong.