"Docker Compose" based CI and testing for MediaWiki extensions, built from mediawiki-ci images.
This repository is to be integrated into other repositories as a Git submodule. It uses "Make" as main entry point and command line interface. The Makefile
contained in this repository must be called up from a Makefile in the other repository.
Ensure, you have Make
and Docker
installed.
make ci
Run all tests with more detailed output and coverage:
make ci-coverage
After the tests have been executed, the containers continue to run in order to carry out analyses in the containers if necessary:
docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8c8606f87631 semanticresultformats:test-1.35-4.1.3 "docker-php-entrypoi…" 25 minutes ago Up 25 minutes 80/tcp semanticresultformats-sqlite-wiki-1
Stop the containers:
make down
Extensions usually required by other extensions are already included and can be used with versions specified by variables.
Extension | Variable |
---|---|
AdminLinks |
|
Chameleon |
|
DisplayTitle |
|
Maps |
|
Mermaid |
|
PageForms |
|
PageSchemas |
|
SemanticMediaWiki |
|
SemanticResultFormats |
|
Variable | Description |
---|---|
MW_VERSION |
|
PHP_VERSION |
|
DB_TYPE |
Database type (mysql, postgres, sqlite) |
DB_IMAGE |
Database Docker image (mysql and postgres only), for example |
EXTENSION |
The name of the extension being tested/CI’ed |
COMPOSER_EXT |
|
NODE_JS |
|
This is an example Makefile (taken from SemanticResultFormats):
-include .env
export
# setup for docker-compose-ci build directory
# delete "build" directory to update docker-compose-ci
ifeq (,$(wildcard ./build/))
$(shell git submodule update --init --remote)
endif
EXTENSION=SemanticResultFormats
# docker images
MW_VERSION?=1.35
PHP_VERSION?=7.4
DB_TYPE?=sqlite
DB_IMAGE?=""
# extensions
SMW_VERSION?=4.1.3
PF_VERSION ?= 5.5.1
SFS_VERSION ?= 4.0.0-beta
MM_VERSION ?= 3.1.0
# composer
# Enables "composer update" inside of extension
COMPOSER_EXT?=true
# nodejs
# Enables node.js related tests and "npm install"
# NODE_JS?=true
# check for build dir and git submodule init if it does not exist
include build/Makefile