Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
* Bumps MW requirements to 1.39+.
* Requires PHP 7.4+
* Adds CI to run tests
  • Loading branch information
paladox committed Dec 31, 2024
1 parent b6dc62b commit fd0f9da
Show file tree
Hide file tree
Showing 14 changed files with 205 additions and 172 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: smw
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://www.semantic-mediawiki.org/wiki/Sponsorship']
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:

test:

runs-on: ubuntu-22.04
continue-on-error: ${{ matrix.experimental }}

strategy:
matrix:
include:
- mediawiki_version: '1.39'
smw_version: dev-master
php_version: 8.1
database_type: mysql
database_image: "mariadb:10"
coverage: false
experimental: false

env:
MW_VERSION: ${{ matrix.mediawiki_version }}
SMW_VERSION: ${{ matrix.smw_version }}
PHP_VERSION: ${{ matrix.php_version }}
DB_TYPE: ${{ matrix.database_type }}
DB_IMAGE: ${{ matrix.database_image }}


steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Update submodules
run: git submodule update --init --remote

- name: Run tests
run: make ci
if: matrix.coverage == false

- name: Run tests with coverage
run: make ci-coverage
if: matrix.coverage == true

- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/php/coverage.xml
if: matrix.coverage == true
21 changes: 16 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
\#*#
.#*
.svn
!.*
*~
*.kate-swp
.*.swp
.idea

.idea/

.envrc
.phpunit.result.cache

composer.lock
composer.phar

npm-debug.log

vendor/
extensions/
composer.lock
node_modules/
conf/
.DS_Store
.env
coverage
3 changes: 3 additions & 0 deletions .gitmodules
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
69 changes: 0 additions & 69 deletions .travis.install.sh

This file was deleted.

28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-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.39
PHP_VERSION?=8.1
DB_TYPE?=mysql
DB_IMAGE?="mariadb:10"

# extensions
SMW_VERSION?=5.2.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

1 change: 1 addition & 0 deletions build
Submodule build added at 10d574
15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,24 @@
"source": "https://github.com/SemanticMediaWiki/SemanticWatchlist"
},
"require": {
"php": ">=7.3",
"php": ">=7.4",
"composer/installers": "1.*,>=1.0.1"
},
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"psr-4": {
"SWL\\": "src/"
}
},
"config": {
"process-timeout": 0
"process-timeout": 0,
"allow-plugins": {
"composer/installers": true
}
},
"scripts": {
"test": [
"@phpunit"
],
"phpunit": "php ../../tests/phpunit/phpunit.php -c phpunit.xml.dist"
}
}
7 changes: 1 addition & 6 deletions extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"license-name": "GPL-3.0-or-later",
"type": "semantic",
"requires": {
"MediaWiki": ">= 1.35"
"MediaWiki": ">= 1.39"
},
"MessagesDirs": {
"SemanticWatchlist": [
Expand All @@ -26,11 +26,6 @@
"AutoloadNamespaces": {
"SWL\\": "src/"
},
"Hooks": {
},
"AutoloadClasses": {
"SWL": "src/"
},
"callback": "SWL\\SemanticWatchlist::initExtension",
"ExtensionFunctions": [
"SWL\\SemanticWatchlist::onExtensionFunction"
Expand Down
2 changes: 1 addition & 1 deletion src/MediaWiki/Hooks/SkinTemplateNavigationUniversal.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* Called after the navigation links have been set up, before they are shown.
* https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Manual:Hooks/SkinTemplateNavigation::Universal
* https://www.mediawiki.org/wiki/Manual:Hooks/SkinTemplateNavigation::Universal
*
* @ingroup SWL
*
Expand Down
Loading

0 comments on commit fd0f9da

Please sign in to comment.