-
-
Notifications
You must be signed in to change notification settings - Fork 21
66 lines (62 loc) · 2.08 KB
/
main.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
name: Run PHPUnit testsuite
on: [push, pull_request, workflow_dispatch]
env:
PARALLEL_PHPUNIT_TESTS: 4
DBNAME: testwiki
DBPASS: "123456"
MEDIAWIKI_USER: "Moderator User"
MEDIAWIKI_PASSWORD: "123456"
jobs:
# Job #2: phpcs, parallel-lint, etc.
linter:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer
- uses: actions/cache@v4
with:
path: ~/.composer/cache
key: buildcache-linter
- name: Install dependencies
run: composer install && npm install
- run: composer test
- run: npm test
# Job #4: Phan (PHP static analyzer) with PHAN_CHECK_TESTSUITE=1
phan-testsuite:
if: ${{ github.ref == 'refs/heads/phan' }}
runs-on: ubuntu-24.04
env:
branch: REL1_43
PHAN_CHECK_TESTSUITE: 1
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: ast
tools: composer
- uses: actions/cache@v4
with:
path: |
~/.composer/cache
buildcache
key: buildcache-phan
- uses: edwardspec/github-action-build-mediawiki@v1
with:
branch: ${{ env.branch }}
noinstall: 1
extensions: "AbuseFilter CheckUser Echo MobileFrontend PageForms VisualEditor"
skins: "MinervaNeue"
- name: Install dependencies
run: |
rsync -a --exclude buildcache --exclude mediawiki --exclude .git . mediawiki/extensions/Moderation/
cd mediawiki/extensions/Moderation
composer install
# Workaround incorrect annotation of with() method in PHPUnit 9 (used in MediaWiki 1.43)
# to avoid over 100 false positive Phan warnings.
sed -i '/@param mixed\[\] \$arguments/d' ../../vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php
- name: RUN -- phan
run: cd mediawiki/extensions/Moderation && ./vendor/bin/phan --analyze-twice