-
-
Notifications
You must be signed in to change notification settings - Fork 130
105 lines (89 loc) · 2.66 KB
/
ci.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
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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
phpunit:
runs-on: ubuntu-latest
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
strategy:
matrix:
php_version: [7.4]
wp_version: [latest]
wp_multisite: [0]
include:
- php_version: 7.4
wp_multisite: 1
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: 'root'
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: mysqli
coverage: xdebug
tools: phpunit-polyfills
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php_version }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php_version }}-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Setup WP
run: script/setup
env:
WP_VERSION: ${{ matrix.wp_version }}
WP_MULTISITE: ${{ matrix.wp_multisite }}
- name: PHPUnit
run: script/cibuild-phpunit
env:
WP_MULTISITE: ${{ matrix.wp_multisite }}
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
directory: ${{ github.workspace }}
verbose: true
flags: php-${{ matrix.php_version }}, wp-${{ matrix.wp_version }}, multisite-${{ matrix.wp_multisite }}
phpcs:
runs-on: ubuntu-latest
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
strategy:
matrix:
php_version: [7.4]
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: mysqli
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php_version }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php_version }}-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: phpcs
run: script/cibuild-phpcs