-
Notifications
You must be signed in to change notification settings - Fork 11
53 lines (44 loc) · 1.54 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
name: CI
on: [push, pull_request]
jobs:
run:
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: wordpress_test
MYSQL_USER: username
MYSQL_PASSWORD: password
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0', '8.1']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring, intl #optional, setup extensions
ini-values-csv: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
coverage: xdebug #optional, setup coverage driver
pecl: false #optional, setup PECL
- name: Check PHP Version
run: php -v
- name: Composer install
run: composer install --optimize-autoloader --prefer-dist
- name: Run PHPCS linter
run: ./vendor/bin/phpcs
- name: Run PHPStan analysis
run: ./vendor/bin/phpstan analyse
- name: Install WP Tests
run: bash docker/install-wp-tests.sh wordpress_test username password 127.0.0.1 latest true
- name: Run PHPUnit tests
run: ./vendor/bin/phpunit