-
Notifications
You must be signed in to change notification settings - Fork 37
85 lines (72 loc) · 2.77 KB
/
integrations.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
name: Run PHPUnit
on:
# Run on all pushes and on all pull requests.
# Prevent the "push" build from running when there are only irrelevant changes.
push:
paths-ignore:
- "**.md"
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:
jobs:
test:
name: WP ${{ matrix.wordpress }} on PHP ${{ matrix.php }}
# Ubuntu-20.x includes MySQL 8.0, which causes `caching_sha2_password` issues with PHP < 7.4
# https://www.php.net/manual/en/mysqli.requirements.php
# TODO: change to ubuntu-latest when we no longer support PHP < 7.4
runs-on: ubuntu-18.04
env:
WP_VERSION: ${{ matrix.wordpress }}
strategy:
matrix:
wordpress: ["5.5", "5.6", "5.7"]
php: ["5.6", "7.0", "7.1", "7.2", "7.3", "7.4"]
include:
- php: "8.0"
# Ignore platform requirements, so that PHPUnit 7.5 can be installed on PHP 8.0 (and above).
composer-options: "--ignore-platform-reqs"
extensions: pcov
ini-values: pcov.directory=., "pcov.exclude=\"~(vendor|tests)~\""
coverage: pcov
exclude:
- php: "8.0"
wordpress: "5.5"
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: ${{ matrix.ini-values }}
coverage: ${{ matrix.coverage }}
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
# Setup PCOV since we're using PHPUnit < 8 which has it integrated. Requires PHP 7.1.
# Ignore platform reqs to make it install on PHP 8.
# https://github.com/krakjoe/pcov-clobber
- name: Setup PCOV
if: ${{ matrix.php == 8.0 }}
run: |
composer require pcov/clobber --ignore-platform-reqs
vendor/bin/pcov clobber
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install Composer dependencies
uses: ramsey/composer-install@v1
with:
composer-options: "${{ matrix.composer-options }}"
- name: Start MySQL Service
run: sudo systemctl start mysql.service
- name: Prepare environment for integration tests
run: composer prepare-ci
- name: Run integration tests (single site)
if: ${{ matrix.php != 8.0 }}
run: composer test
- name: Run integration tests (single site with code coverage)
if: ${{ matrix.php == 8.0 }}
run: composer coverage-ci
- name: Run integration tests (multisite)
run: composer test-ms