mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-23 15:57:10 +00:00
Update workflow (#45)
This commit is contained in:
parent
e9fa767f97
commit
62f733ed00
46
.github/workflows/mediawiki-linting.yml
vendored
46
.github/workflows/mediawiki-linting.yml
vendored
|
@ -1,46 +0,0 @@
|
|||
name: PHPCS
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
phpcs:
|
||||
name: PHPCS
|
||||
continue-on-error: true
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- 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-php8
|
||||
|
||||
# Only patch code when it is a push event
|
||||
- name: Push the changes
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
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
|
94
.github/workflows/mediawiki-tests.yml
vendored
94
.github/workflows/mediawiki-tests.yml
vendored
|
@ -52,7 +52,7 @@ jobs:
|
|||
- mw: 'master'
|
||||
php: 7.3
|
||||
php-docker: 73
|
||||
experimental: true
|
||||
experimental: false
|
||||
stage: coverage
|
||||
|
||||
# Latest stable MediaWiki - PHP 7.3 (phpunit-unit)
|
||||
|
@ -73,7 +73,7 @@ jobs:
|
|||
- mw: 'master'
|
||||
php: 7.3
|
||||
php-docker: 73
|
||||
experimental: true
|
||||
experimental: false
|
||||
stage: phpunit-unit
|
||||
|
||||
# Latest MediaWiki master - PHP 7.4 (phpunit-unit)
|
||||
|
@ -111,34 +111,6 @@ jobs:
|
|||
experimental: true
|
||||
stage: phpunit
|
||||
|
||||
# Latest stable MediaWiki - PHP 7.3 (phpunit-standalone)
|
||||
# - mw: 'REL1_37'
|
||||
# php: 7.3
|
||||
# php-docker: 73
|
||||
# experimental: false
|
||||
# stage: phpunit-standalone
|
||||
|
||||
# Latest stable MediaWiki - PHP 7.4 (phpunit-standalone)
|
||||
# - mw: 'REL1_37'
|
||||
# php: 7.4
|
||||
# php-docker: 74
|
||||
# experimental: false
|
||||
# stage: phpunit-standalone
|
||||
|
||||
# Latest MediaWiki master - PHP 7.3 (phpunit-standalone)
|
||||
# - mw: 'master'
|
||||
# php: 7.3
|
||||
# php-docker: 73
|
||||
# experimental: true
|
||||
# stage: phpunit-standalone
|
||||
|
||||
# Latest MediaWiki master - PHP 7.4 (phpunit-standalone)
|
||||
# - mw: 'master'
|
||||
# php: 7.4
|
||||
# php-docker: 74
|
||||
# experimental: true
|
||||
# stage: phpunit-standalone
|
||||
|
||||
# Latest stable MediaWiki - PHP 7.3 (selenium)
|
||||
- mw: 'REL1_37'
|
||||
php: 7.3
|
||||
|
@ -150,7 +122,7 @@ jobs:
|
|||
- mw: 'master'
|
||||
php: 7.3
|
||||
php-docker: 73
|
||||
experimental: true
|
||||
experimental: false
|
||||
stage: selenium
|
||||
|
||||
# Latest stable MediaWiki - PHP 7.3 (qunit)
|
||||
|
@ -164,7 +136,7 @@ jobs:
|
|||
- mw: 'master'
|
||||
php: 7.3
|
||||
php-docker: 73
|
||||
experimental: true
|
||||
experimental: false
|
||||
stage: qunit
|
||||
|
||||
# Latest stable MediaWiki - PHP 7.3 (npm-test)
|
||||
|
@ -174,13 +146,6 @@ jobs:
|
|||
experimental: false
|
||||
stage: npm-test
|
||||
|
||||
# Latest MediaWiki master - PHP 7.3 (npm-test)
|
||||
- mw: 'master'
|
||||
php: 7.3
|
||||
php-docker: 73
|
||||
experimental: true
|
||||
stage: npm-test
|
||||
|
||||
# Latest stable MediaWiki - PHP 7.3 (composer-test)
|
||||
- mw: 'REL1_37'
|
||||
php: 7.3
|
||||
|
@ -188,13 +153,6 @@ jobs:
|
|||
experimental: false
|
||||
stage: composer-test
|
||||
|
||||
# Latest MediaWiki master - PHP 7.3 (composer-test)
|
||||
- mw: 'master'
|
||||
php: 7.3
|
||||
php-docker: 73
|
||||
experimental: true
|
||||
stage: composer-test
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
|
@ -205,13 +163,19 @@ jobs:
|
|||
PHAN_DOCKER_IMAGE: mediawiki-phan-php${{ matrix.php-docker }}
|
||||
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.9.1
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# /home/runner/cache/ Cache
|
||||
# /home/runner/src/ Mediawiki installation
|
||||
# /home/runner/src/extensions/EXTENSION_NAME/ Clone of the extension repository
|
||||
# /home/runner/docker-images/ Docker images which exported with docker-save command
|
||||
# $GITHUB_WORKSPACE/.github/workflows/dependencies Used by actions/cache
|
||||
# $GITHUB_WORKSPACE/.github/workflows/dependencies Necessary dependencies - YAML syntax
|
||||
# $GITHUB_WORKSPACE/.github/workflows/globals.php Add global configuration options for MediaWiki
|
||||
- name: Set up
|
||||
run: |
|
||||
echo MEDIAWIKI_VERSION="${{ matrix.mw }}" >> $GITHUB_ENV
|
||||
|
@ -276,10 +240,20 @@ jobs:
|
|||
for dep in $DEPENDENCIES; do
|
||||
dependency=$(echo $dep | cut -d'|' -f1)
|
||||
repository=$(echo $dep | cut -sd'|' -f2)
|
||||
branch=$(echo $dep | cut -sd'|' -f3)
|
||||
git clone --recurse-submodules -b "${branch:-${MEDIAWIKI_VERSION}}" --depth 1 "${repository:-https://gerrit.wikimedia.org/r/${dep}}" src/"$(echo $dependency | cut -d'/' -f2,3)"
|
||||
branch=$(echo $dep | rev | cut -sd'|' -f1 | rev)
|
||||
|
||||
if [ $repository == $branch ]; then
|
||||
repository=""
|
||||
fi
|
||||
|
||||
git clone --recurse-submodules -b "${branch:-${MEDIAWIKI_VERSION}}" --depth 1 "${repository:-https://gerrit.wikimedia.org/r/${dependency}}" src/"$(echo $dependency | cut -d'/' -f2,3)"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -e "$GITHUB_WORKSPACE"/.github/workflows/globals.php ]; then
|
||||
echo 'require_once __DIR__ . "/../extensions/${{ github.event.repository.name }}/.github/workflows/globals.php";' >> src/includes/DevelopmentSettings.php
|
||||
fi
|
||||
|
||||
git -C src/ log -n 1 --format="%H"
|
||||
|
||||
- name: Cache dependencies (composer and npm)
|
||||
|
@ -302,6 +276,28 @@ jobs:
|
|||
composer install --prefer-dist --no-progress --no-interaction
|
||||
fi
|
||||
|
||||
- name: Fix PHPCS violations
|
||||
continue-on-error: true
|
||||
if: ${{ github.event_name == 'pull_request' && matrix.stage == 'composer-test' }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
if [ -e composer.json ]; then
|
||||
composer install --prefer-dist --no-progress --no-interaction
|
||||
composer fix
|
||||
|
||||
rm composer.lock
|
||||
|
||||
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 checkout -b ${GITHUB_HEAD_REF}
|
||||
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 origin ${GITHUB_HEAD_REF} --rebase
|
||||
git push --set-upstream origin ${GITHUB_HEAD_REF}
|
||||
fi
|
||||
|
||||
- name: Main Test
|
||||
continue-on-error: ${{ matrix.experimental }}
|
||||
run: |
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset>
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
|
||||
<file>.</file>
|
||||
<arg name="bootstrap" value="./vendor/mediawiki/mediawiki-codesniffer/utils/bootstrap-ci.php"/>
|
||||
<arg name="extensions" value="php"/>
|
||||
<arg name="encoding" value="UTF-8"/>
|
||||
<exclude-pattern>*/vendor/*</exclude-pattern>
|
||||
<exclude-pattern>*/out/*</exclude-pattern>
|
||||
<exclude-pattern>*/tests/*</exclude-pattern>
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
|
||||
<exclude name="Generic.Files.LineLength.TooLong" />
|
||||
<exclude name="MediaWiki.Commenting" />
|
||||
</rule>
|
||||
<arg name="bootstrap" value="./vendor/mediawiki/mediawiki-codesniffer/utils/bootstrap-ci.php"/>
|
||||
<arg name="extensions" value="php"/>
|
||||
<arg name="encoding" value="UTF-8"/>
|
||||
</ruleset>
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
},
|
||||
"scripts": {
|
||||
"fix": [
|
||||
"minus-x fix ."
|
||||
"minus-x fix .",
|
||||
"phpcbf; if [ $? -eq 1 ]; then exit 0; fi"
|
||||
],
|
||||
"test": [
|
||||
"parallel-lint . --exclude node_modules --exclude vendor",
|
||||
|
|
Loading…
Reference in a new issue