-
Notifications
You must be signed in to change notification settings - Fork 9
152 lines (147 loc) · 4.47 KB
/
ci.yml
File metadata and controls
152 lines (147 loc) · 4.47 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Continuous Integration
permissions:
contents: read
on:
push:
branches:
- main
- specialPageList # Add your development branch
pull_request:
env:
EXTNAME: CrawlerProtection
MW_INSTALL_PATH: ${{ github.workspace }}
jobs:
style:
name: Code Style
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
php: [ '8.2', '8.3', '8.4' ]
mediawiki: [ REL1_43 ]
include:
- os: ubuntu-latest
php: '7.4'
mediawiki: REL1_35
- os: ubuntu-latest
php: '7.4'
mediawiki: REL1_39
- os: ubuntu-latest
php: '8.1'
mediawiki: REL1_39
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl
coverage: none
tools: composer
- name: Setup MediaWiki
uses: actions/checkout@v4
with:
repository: wikimedia/mediawiki
ref: ${{ matrix.mediawiki }}
- name: Setup Extension
uses: actions/checkout@v4
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: Lint
run: ./vendor/bin/parallel-lint --exclude node_modules --exclude vendor extensions/${{ env.EXTNAME }}
- name: PHP Code Sniffer
run: cd extensions/${{ env.EXTNAME }} && ../../vendor/bin/phpcs -sp
security:
name: Static Analysis
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
# 1.43 phan is broken on php 8.4
php: [ '8.2', '8.3' ]
mediawiki: [ REL1_43 ]
include:
- os: ubuntu-latest
php: '7.4'
mediawiki: REL1_35
- os: ubuntu-latest
php: '7.4'
mediawiki: REL1_39
- os: ubuntu-latest
php: '8.1'
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@v4
with:
repository: wikimedia/mediawiki
ref: ${{ matrix.mediawiki }}
- name: Setup Extension
uses: actions/checkout@v4
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
phpunit:
name: Unit Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
php: [ '8.2', '8.3', '8.4' ]
mediawiki: [ REL1_43 ]
include:
- os: ubuntu-latest
php: '7.4'
mediawiki: REL1_35
- os: ubuntu-latest
php: '7.4'
mediawiki: REL1_39
- os: ubuntu-latest
php: '8.2'
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@v4
with:
repository: wikimedia/mediawiki
ref: ${{ matrix.mediawiki }}
- name: Setup Extension
uses: actions/checkout@v4
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: Install MediaWiki
run: php maintenance/install.php --dbtype=sqlite --with-extensions --pass=UnitTestingAdminPassword519 UnitTesting WikiAdmin
- name: Phpunit
run: ./vendor/bin/phpunit -- extensions/${{ env.EXTNAME }}/tests/phpunit