diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df5ea06..f09781f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,7 @@ jobs: mediawiki !mediawiki/extensions/ !mediawiki/vendor/ - key: mw_${{ matrix.mw }}-php${{ matrix.php }} + key: mw_${{ matrix.mw }}-php${{ matrix.php }}-v2 - name: Cache Composer cache uses: actions/cache@v4 @@ -102,14 +102,24 @@ jobs: working-directory: ~ run: bash EarlyCopy/.github/workflows/uploadImages.sh - - if: env.TYPE != 'coverage' + - if: env.TYPE != 'coverage' && matrix.mw != 'master' name: Run PHPUnit w/o coverage run: php tests/phpunit/phpunit.php -c extensions/BootstrapComponents/ --testsuite bootstrap-components-unit - - if: env.TYPE == 'coverage' + - if: env.TYPE == 'coverage' && matrix.mw != 'master' name: Run PHPUnit w/ coverage run: php tests/phpunit/phpunit.php -c extensions/BootstrapComponents/ --testsuite bootstrap-components-unit --coverage-clover coverage.clover + - if: matrix.mw == 'master' + name: Run PHPUnit (MW master) + run: | + # MediaWiki master (≥ 1.46) removed tests/phpunit/phpunit.php; the + # supported runner is vendor/bin/phpunit against the config + # generated by `composer phpunit:config` from phpunit.xml.template + # (which installWiki.sh's git clone ships). + composer phpunit:config + vendor/bin/phpunit -c extensions/BootstrapComponents/phpunit.xml.dist --bootstrap tests/phpunit/bootstrap.php --testsuite bootstrap-components-unit + - if: env.TYPE == 'coverage' name: upload coverage report working-directory: ~ diff --git a/.github/workflows/installWiki.sh b/.github/workflows/installWiki.sh index 62b6662..41d7b53 100644 --- a/.github/workflows/installWiki.sh +++ b/.github/workflows/installWiki.sh @@ -4,10 +4,12 @@ MW_BRANCH=$1 EXTENSION_NAME=$2 ## install core -wget https://github.com/wikimedia/mediawiki/archive/${MW_BRANCH}.tar.gz -nv - -tar -zxf $MW_BRANCH.tar.gz -mv mediawiki-$MW_BRANCH mediawiki +# Clone rather than fetch the tarball: MW's .gitattributes marks +# phpunit.xml.template as `export-ignore`, so it's absent from the +# archive that GitHub serves. `composer phpunit:config` on MW master +# needs that file; `git clone` ships it. ~40MB extra in cached +# `.git/`, no measurable time difference. +git clone --depth 1 --branch "$MW_BRANCH" https://github.com/wikimedia/mediawiki.git mediawiki cd $MW_ROOT composer install