-
Notifications
You must be signed in to change notification settings - Fork 86
73 lines (67 loc) · 2.27 KB
/
php-test.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
name: PHP Unit Tests
on:
push:
branches:
- trunk
- 'release/**'
# TODO: Add paths.
pull_request:
# TODO: Add paths.
types:
- opened
- reopened
- synchronize
permissions: {}
jobs:
unit-test-main-plugin:
name: "PerfLab / PHP ${{ matrix.environment.php }} / WP ${{ matrix.environment.wp }} ${{ 'true' == matrix.multisite && '/ Multisite'}}"
runs-on: ubuntu-latest
timeout-minutes: 20
env:
WP_CORE_DIR: /tmp/wordpress
WP_TESTS_DIR: /tmp/wordpress-tests-lib
WP_ENVIRONMENT_TYPE: local
services:
mysql:
image: mariadb:latest
env:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true
MARIADB_DATABASE: wordpress_test
MARIADB_MYSQL_LOCALHOST_USER: 1
MARIADB_MYSQL_LOCALHOST_GRANTS: USAGE
ports:
- 3306
options: --health-cmd="healthcheck.sh --su-mysql --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
multisite: ['true', 'false']
environment:
[
{ php: '7.0', phpunit: '6', wp: 'latest' },
{ php: '7.1', phpunit: '7', wp: 'latest' },
{ php: '7.2', phpunit: '7', wp: 'latest' },
{ php: '7.3', phpunit: '7', wp: 'latest' },
{ php: '7.4', phpunit: '9.3', wp: 'latest' },
{ php: '8.0', phpunit: '9.3', wp: 'latest' },
{ php: '8.1', phpunit: '9.6', wp: 'latest' },
{ php: '8.2', phpunit: '9.6', wp: 'latest' },
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup WP tests
uses: ./.github/actions/setup-wp-tests
with:
wp: ${{ matrix.environment.wp }}
php: ${{ matrix.environment.php }}
phpunit: ${{ matrix.environment.phpunit }}
multisite-tests: ${{ matrix.multisite }}
mysql-port: ${{ job.services.mysql.ports['3306'] }}
- name: Run ${{ 'true' == matrix.multisite && 'Multisite' || 'Single Site' }} tests
shell: bash
run: |
phpunit --verbose
working-directory: ${{ env.WP_CORE_DIR }}/src/wp-content/plugins/performance
env:
WP_MULTISITE: ${{ 'true' == matrix.multisite && 1 || 0 }}