PortableInfobox/.github/workflows/mediawiki-tests.yml

91 lines
2.5 KiB
YAML
Raw Normal View History

2021-09-11 18:55:27 +00:00
name: MediaWiki tests
on:
push:
pull_request:
branches: [ master ]
jobs:
test:
name: "MediaWiki ${{ matrix.mw }} | PHP ${{ matrix.php }}"
continue-on-error: true
strategy:
matrix:
include:
# Latest stable MediaWiki - PHP 7.3
- mw: 'REL1_36'
php: 7.3
continue-on-error: false
# Latest stable MediaWiki - PHP 7.4
- mw: 'REL1_36'
php: 7.4
2021-09-11 23:46:15 +00:00
continue-on-error: false
2021-09-11 18:55:27 +00:00
2021-09-11 23:46:15 +00:00
# Latest MediaWiki master - PHP 7.3
2021-09-11 18:55:27 +00:00
- mw: 'master'
php: 7.3
continue-on-error: true
2021-09-11 23:46:15 +00:00
# Latest MediaWiki master - PHP 7.4
- mw: 'master'
php: 7.4
continue-on-error: true
2021-09-11 23:46:15 +00:00
# Latest MediaWiki master - PHP 8.0
- mw: 'master'
php: 8.0
2021-09-11 18:55:27 +00:00
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl,ast
2021-09-13 21:58:30 +00:00
tools: composer:v2
2021-09-11 18:55:27 +00:00
- name: Install dependencies
run: |
composer validate
composer update
- name: Check PHP
run: |
sh phpcbf.sh
composer fix
composer test
- name: Cache Composer cache
uses: actions/cache@v2
with:
path: ~/.composer/cache
key: composer-php${{ matrix.php }}
- name: Download MediaWiki
run: |
bash .github/workflows/download-mediawiki.sh ${{ matrix.mw }}
git clone https://github.com/wikimedia/mediawiki-extensions-PageImages.git --depth=1 --branch=${{ matrix.mw }} mediawiki/extensions/PageImages
- name: Run phan
continue-on-error: ${{ matrix.continue-on-error }}
run: |
composer phan
# Only patch code when it is a push event
- name: Push the changes
if: ${{ github.event_name == 'push' }}
2021-09-11 18:55:27 +00:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git add .
git commit -am "CI: lint code to MediaWiki standards" -m "Check commit and GitHub actions for more details" || echo "No changes to commit"
git pull --rebase
git push