mediawiki-skins-Citizen/.github/workflows/mediawiki.yml
alistair3149 f72af5e76d
Improve CI and code clean up (#143)
* Replace existing grunt linter

* Fix stylesheet issues picked up by stylelint

* Update the git workflow

* Fix incorrect slash in workflow file

* Github CI lint - eslint/stylelint

* Clean up composer

* Fix phpcb error

* MediaWiki CI

* Change commit message

* Update status badge

* Add JSDoc

* Add SVGO

* Make a dinner reservation - MediaWiki CI

I clean up code to MediaWiki standards

* Optimize SVG files with SVGO

Co-authored-by: github-actions <github-actions@users.noreply.github.com>
2020-06-16 22:49:41 -04:00

58 lines
1.4 KiB
YAML

name: MediaWiki CI
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
composer validate
npm install --save-dev
composer install --prefer-dist --no-progress --no-suggest
# Bypass the phpcbf non-standard exit code
- name: Check PHP
run: |
sh ./bin/phpcbf.sh
composer fix
composer test
- name: Check Javascript
run: |
npm run lint:fix:js
npm run lint:js
- name: Check CSS/LESS
run: |
npm run lint:fix:styles
npm run lint:styles
- name: Check i18n
run: |
npm run lint:i18n
# 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 "Make a dinner reservation - MediaWiki CI" -m "I clean up code to MediaWiki standards" || echo "No changes to commit"
git push