-
Notifications
You must be signed in to change notification settings - Fork 8
71 lines (68 loc) · 2.18 KB
/
test-php.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
name: Test PHP
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
phplint:
name: PHPCS on PHP 8.0
runs-on: ubuntu-latest
steps:
- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: simplexml
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Run PHPCS
run: composer phpcs
phpunit:
name: PHPUnit tests on ${{ matrix.php-versions }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
services:
database:
image: mysql:latest
env:
MYSQL_DATABASE: wordpress_tests
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
steps:
- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: simplexml, mysql
tools: phpunit-polyfills:1.1
- name: Install Subversion
run: sudo apt-get update && sudo apt-get install -y subversion
- name: Checkout source code
uses: actions/checkout@v4
- name: Install WordPress Test Suite
run: composer install-wp-tests
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Run phpunit
run: composer phpunit
phpstan:
name: PHPStan on PHP 8.0
runs-on: ubuntu-latest
steps:
- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: simplexml, mysql
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: PHPStan Static Analysis
run: composer phpstan