-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
76 lines (68 loc) · 2.05 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: 'Mediawiki Extension PHPUnit Runner'
description: 'Setups MediaWiki and runs PHPUnit test for an extension'
author: 'WikiTeq'
branding:
color: yellow
icon: book-open
inputs:
php:
description: 'PHP version'
required: true
mwbranch:
description: 'Mediawiki branch to test against'
required: true
extension:
description: 'Extension name to test'
required: true
type:
description: 'Is it an extension or skin'
required: false
default: 'extension'
extra_file:
description: 'Path relative to the extension for a PHP file to load in settings'
required: false
default: ''
use_mysql:
description: Use MySQL instead of SQLite
required: false
default: false
runs:
using: 'composite'
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php }}
extensions: ${{ env.PHP_EXTENSIONS }}
tools: composer:2.1.14
env:
PHP_EXTENSIONS: ${{ inputs.use_mysql && 'mbstring, intl, mysqli' || 'mbstring, intl' }}
- name: Add Composer cache
uses: actions/cache@v2
with:
path: ~/.composer/cache
key: composer-php${{ inputs.php }}
- name: Download Mediawiki
uses: actions/checkout@v2
with:
path: mediawiki
repository: wikimedia/mediawiki
ref: ${{ inputs.mwbranch }}
- name: Install MediaWiki
run: bash $GITHUB_ACTION_PATH/install.sh ${{ inputs.extension }} ${{ inputs.type }} ${{ inputs.use_mysql }} ${{ inputs.extra_file }}
shell: bash
- uses: actions/checkout@v2
with:
path: mediawiki/${{ inputs.type }}s/${{ inputs.extension }}
- name: Composer updates
working-directory: mediawiki
run: composer update
shell: bash
- name: Run updates
working-directory: mediawiki
run: php maintenance/update.php --quick
shell: bash
- name: Run PHPUnit
working-directory: mediawiki
run: php tests/phpunit/phpunit.php --testsuite extensions --exclude-group Broken,ParserFuzz,Stub
shell: bash