-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (111 loc) · 3.18 KB
/
ci.yml
File metadata and controls
129 lines (111 loc) · 3.18 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Continuous Integration
on:
push:
branches:
- master
pull_request:
env:
EXTNAME: StatusCheck
MW_INSTALL_PATH: ${{ github.workspace }}
jobs:
style-php:
name: Code Style (PHP)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.3' ]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl
coverage: none
tools: composer, phplint
- name: Setup Extension
uses: actions/checkout@v5
- name: Setup Composer
run: composer update
- name: Lint
run: phplint -w --exclude=vendor
- name: PHP Code Sniffer
run: vendor/bin/phpcs -sp --standard=.phpcs.xml .
security:
name: Static Analysis
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.1', '8.3' ]
mediawiki: [ REL1_39, REL1_43 ]
exclude:
# MW 1.43 requires PHP 8.1+
- php: '7.4'
mediawiki: REL1_43
# MW 1.39 requires mediawiki/mediawiki-phan-config@0.12.1 which
# requires mediawiki/phan-taint-check-plugin@4.0.0 which crashes
# on PHP 8.2+ due to use of deprecated string interpolation
- php: '8.3'
mediawiki: REL1_39
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, ast
coverage: none
tools: composer
- name: Setup MediaWiki
uses: actions/checkout@v3
with:
repository: wikimedia/mediawiki
ref: ${{ matrix.mediawiki }}
- name: Setup Extension
uses: actions/checkout@v5
with:
path: extensions/${{ env.EXTNAME }}
- name: Setup Composer
run: |
echo '{"extra":{"merge-plugin":{"include":["extensions/*/composer.json","skins/*/composer.json"]}}}' > composer.local.json
composer update
composer update
- name: Phan
run: ./vendor/bin/phan -d extensions/${{ env.EXTNAME }} --minimum-target-php-version=7.4 --long-progress-bar
npm:
name: NPM linting and tests
runs-on: ubuntu-latest
steps:
- name: Setup node
uses: actions/setup-node@v5
with:
node-version: 22
- name: Setup Extension
uses: actions/checkout@v5
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
test:
name: PHPUnit
runs-on: ubuntu-latest
env:
MW_INSTALL_PATH: ${{ github.workspace }}/mediawiki
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.1', '8.3' ]
mediawiki: [ REL1_39, REL1_43 ]
exclude:
- php: '7.4'
mediawiki: REL1_43
steps:
- name: Setup Extension
uses: actions/checkout@v5
- name: Mediawiki PHPUnit
uses: wikiteq/mediawiki-phpunit-action@master
with:
type: extension
php: ${{ matrix.php }}
mwbranch: ${{ matrix.mediawiki }}
extension: ${{ env.EXTNAME }}