Skip to content

PLATFORM-9061| setup Github Actions workflows #4

PLATFORM-9061| setup Github Actions workflows

PLATFORM-9061| setup Github Actions workflows #4

Workflow file for this run

name: PHPUnit / PHPCS / Phan
on:
pull_request:
branches: '**'
push:
branches: [ master, REL1_39 ]
jobs:
build:
strategy:
matrix:
php_version: ['8.0']
mw: ['REL1_39', 'master']
runs-on: ubuntu-latest
steps:
- name: Setup PHP
if: $${{ matrix.mw }} == $${{ github.ref }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
# We don't run any coverage, so we should set this parameter to none
# as this will disable xdebug which slows all processes significantly
coverage: none
extensions: ast
- uses: actions/checkout@v4
if: $${{ matrix.mw }} == $${{ github.ref }}
- name: Checkout Mediawiki
if: $${{ matrix.mw }} == $${{ github.ref }}
uses: actions/checkout@v4
with:
repository: wikimedia/mediawiki
ref: ${{ matrix.mw }}
- name: Checkout Cargo extension
if: $${{ matrix.mw }} == $${{ github.ref }}
uses: actions/checkout@v3
with:
path: extensions/Cargo
- name: Cache Cargo composer dependencies
if: $${{ matrix.mw }} == $${{ github.ref }}
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-v3-${{ hashFiles('extensions/Cargo/composer.lock') }}
- name: Install Cargo composer dependencies
if: $${{ matrix.mw }} == $${{ github.ref }}
working-directory: ./extensions/Cargo
run: composer install --prefer-dist --no-progress
- name: Run PHPCS and minus-x
if: $${{ matrix.mw }} == $${{ github.ref }}
working-directory: ./extensions/Cargo
run: composer test
- name: Start MySQL
if: $${{ matrix.mw }} == $${{ github.ref }}
run: sudo systemctl start mysql.service
- name: Install MediaWiki composer dependencies
if: $${{ matrix.mw }} == $${{ github.ref }}
run: composer update --prefer-dist --no-progress
- name: Install & configure MediaWiki
if: $${{ matrix.mw }} == $${{ github.ref }}
run: |
php maintenance/install.php --dbtype mysql --dbuser root --dbpass root --pass TestPassword testwiki TestAdmin
echo 'error_reporting( E_ALL | E_STRICT );' >> LocalSettings.php
echo 'ini_set( "display_errors", 1 );' >> LocalSettings.php
echo '$wgShowExceptionDetails = true;' >> LocalSettings.php
echo '$wgShowDBErrorBacktrace = true;' >> LocalSettings.php
echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php
echo 'wfLoadExtension( "'Cargo'" );' >> LocalSettings.php
- name: Run schema changes
if: $${{ matrix.mw }} == $${{ github.ref }}
run: php maintenance/update.php --quick
- name: Run PHPUnit tests
if: $${{ matrix.mw }} == $${{ github.ref }}
run: php tests/phpunit/phpunit.php extensions/Cargo/tests