-
-
Notifications
You must be signed in to change notification settings - Fork 14
83 lines (73 loc) · 2.33 KB
/
code-coverage.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
name: Code Coverage
on:
push:
branches:
- main
- development
pull_request:
branches:
types: [closed]
schedule:
- cron: '0 0 * * 0'
jobs:
code-coverage:
name: WordPress ${{ matrix.wordpress-versions }} - PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
services:
mysql-service:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
strategy:
matrix:
php-versions: [ '8.2' ]
wordpress-versions: [ '6.2' ]
operating-system: [ ubuntu-22.04 ]
env:
UTMDC_BITLY_API: ${{secrets.UTMDC_BITLY_API}}
UTMDC_REBRANDLY_API: ${{secrets.UTMDC_REBRANDLY_API}}
UTMDC_PLUGIN_DIR: ${{secrets.UTMDC_PLUGIN_DIR}}
steps:
- name: Start MySQL
run: sudo /etc/init.d/mysql start
- name: Setup PHP
# Commit hash for v2.25.4: https://github.com/shivammathur/setup-php/releases/tag/2.25.4
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
- name: Log Debug Information
run: |
echo "$GITHUB_REF"
echo "$GITHUB_EVENT_NAME"
php --version
mysql --version
lsb_release -a
- name: Checkout utm.codes
# Commit hash for v3.5.3: https://github.com/actions/checkout/releases/tag/v3.5.3
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
fetch-depth: 1
- name: Install PHPUnit
run: |
composer require phpunit/phpunit:^9 --update-with-dependencies
- name: Install WordPress
run: |
bash _test/bin/install-wp-tests.sh wordpress_test root root localhost:3306 ${{ matrix.wordpress-versions }}
- name: Generate Coverage Report
run: |
cd _test
mkdir -p build/logs
../vendor/bin/phpunit
- name: Upload coverage to Codecov
run: |
bash <(curl -s https://codecov.io/bash)