diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4e7ac3..e7af5d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,9 +24,9 @@ jobs: - mw: 'REL1_45' php: 8.3 experimental: false - - mw: 'master' + - mw: 'REL1_46' php: 8.4 - experimental: true + experimental: false - mw: 'master' php: 8.5 experimental: true @@ -53,7 +53,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 @@ -80,21 +80,12 @@ jobs: - name: Composer update run: composer update - # "master" currently tracks MW >= 1.46, where tests/phpunit/phpunit.php - # was removed. Once REL1_46 lands in the matrix, it needs the master - # invocation below as well. - - name: Run PHPUnit (MW < master) - if: matrix.mw != 'master' - run: php tests/phpunit/phpunit.php -c extensions/Bootstrap/ - - - name: Run PHPUnit (MW master) - if: matrix.mw == 'master' + - name: Run PHPUnit run: | - # TODO: phpunit.xml.template is export-ignored from GitHub's tarball - # archive, so we fetch it separately. Remove this once installWiki.sh - # switches to `git clone`, or MW drops the export-ignore. - if [ ! -f phpunit.xml.template ]; then - wget -q -O phpunit.xml.template "https://raw.githubusercontent.com/wikimedia/mediawiki/${{ matrix.mw }}/phpunit.xml.template" + if [ -f tests/phpunit/phpunit.php ]; then + php tests/phpunit/phpunit.php -c extensions/Bootstrap/ + else + # MW 1.46 and later + composer phpunit:config + vendor/bin/phpunit --group extension-bootstrap fi - composer phpunit:config - vendor/bin/phpunit --group extension-bootstrap diff --git a/.github/workflows/installWiki.sh b/.github/workflows/installWiki.sh index 4439067..bc3e4ce 100644 --- a/.github/workflows/installWiki.sh +++ b/.github/workflows/installWiki.sh @@ -3,10 +3,7 @@ MW_BRANCH=$1 EXTENSION_NAME=$2 -wget https://github.com/wikimedia/mediawiki/archive/$MW_BRANCH.tar.gz -nv - -tar -zxf $MW_BRANCH.tar.gz -mv mediawiki-$MW_BRANCH mediawiki +git clone --depth 1 --branch ${MW_BRANCH} https://github.com/wikimedia/mediawiki.git mediawiki cd mediawiki