Skip to content

Set up CI and make pass, support MediaWiki 1.43, and clean up #5

Set up CI and make pass, support MediaWiki 1.43, and clean up

Set up CI and make pass, support MediaWiki 1.43, and clean up #5

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- master
pull_request:
env:
EXTNAME: StatusCheck
MW_INSTALL_PATH: ${{ github.workspace }}
jobs:
style-php:
name: Code Style (PHP)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.1' ]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl
coverage: none
tools: composer, phplint
- name: Setup Extension
uses: actions/checkout@v5
- name: Setup Composer
run: composer update
- name: Lint
run: phplint -w --exclude=vendor
- name: PHP Code Sniffer
run: vendor/bin/phpcs -sp --standard=.phpcs.xml .
security:
name: Static Analysis
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.1' ]
mediawiki: [ REL1_39, REL1_43 ]
exclude:
- php: '7.4'
mediawiki: REL1_39
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, ast
coverage: none
tools: composer
- name: Setup MediaWiki
uses: actions/checkout@v3
with:
repository: wikimedia/mediawiki
ref: ${{ matrix.mediawiki }}
- name: Setup Extension
uses: actions/checkout@v5
with:
path: extensions/${{ env.EXTNAME }}
- name: Setup Composer
run: |
echo '{"extra":{"merge-plugin":{"include":["extensions/*/composer.json","skins/*/composer.json"]}}}' > composer.local.json
composer update
composer update
- name: Phan
run: ./vendor/bin/phan -d extensions/${{ env.EXTNAME }} --minimum-target-php-version=7.4 --long-progress-bar
npm:
name: NPM linting and tests
runs-on: ubuntu-latest
steps:
- name: Setup node
uses: actions/setup-node@v5
with:
node-version: 22
- name: Setup Extension
uses: actions/checkout@v5
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
test:
name: PHPUnit
runs-on: ubuntu-latest
env:
MW_INSTALL_PATH: ${{ github.workspace }}/mediawiki
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.1' ]
mediawiki: [ REL1_39, REL1_43 ]
exclude:
- php: '7.4'
mediawiki: REL1_39
steps:
- name: Setup Extension
uses: actions/checkout@v5
- name: Mediawiki PHPUnit
uses: wikiteq/mediawiki-phpunit-action@master
with:
type: extension
php: ${{ matrix.php }}
mwbranch: ${{ matrix.mediawiki }}
extension: ${{ env.EXTNAME }}