Skip to content

Commit

Permalink
Combine CI files (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega committed Sep 10, 2021
1 parent 4f71c56 commit b0e1df0
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
name: PHP tests
name: MediaWiki tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: "${{ matrix.mw }} | ${{ matrix.repo }} | ${{ matrix.php }}"
name: "${{ matrix.mw }} | ${{ matrix.repo }} | PHP ${{ matrix.php }}"
continue-on-error: true
strategy:
matrix:
include:
# Miraheze version
# Miraheze version - PHP 7.3
- mw: 'REL1_36'
repo: 'miraheze'
php: 7.3
composer: v2
continue-on-error: false

# Miraheze version - PHP 7.4
- mw: 'REL1_36'
repo: 'miraheze'
php: 7.4
composer: v2
continue-on-error: true

# Latest stable MediaWiki
- mw: 'REL1_36'
repo: 'wikimedia'
php: 7.3
composer: v2
continue-on-error: false

# Latest MediaWiki master
- mw: 'master'
repo: 'wikimedia'
php: 7.3
composer: v2
continue-on-error: true

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -35,6 +50,25 @@ jobs:
php-version: ${{ matrix.php }}
extensions: intl,ast
tools: composer:${{ matrix.composer }}

- name: Install dependencies
run: |
composer validate
composer update
npm install --save-dev
- name: Check PHP
if: ${{ matrix.mw == 'master' }}
run: |
sh phpcbf.sh
composer fix
composer test
- name: Check i18n
if: ${{ matrix.mw == 'master' }}
run: |
npm run lint:i18n
- name: Cache MediaWiki
id: cache-mediawiki
uses: actions/cache@v2
Expand Down Expand Up @@ -75,6 +109,20 @@ jobs:
git submodule update --init extensions/SocialProfile
- name: Run phan
continue-on-error: ${{ matrix.continue-on-error }}
run: |
composer update
composer phan
# Only patch code when it is a push event
- name: Push the changes
if: github.event_name == 'push' && matrix.mw == 'master'
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
2 changes: 1 addition & 1 deletion .github/workflows/notify.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: notify
on:
workflow_run:
workflows: ["PHP tests", "Linting"]
workflows: ["MediaWiki tests"]
types: [completed]

jobs:
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/test-lint.yml

This file was deleted.

0 comments on commit b0e1df0

Please sign in to comment.