-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (76 loc) · 2.59 KB
/
phpunit.yml
File metadata and controls
90 lines (76 loc) · 2.59 KB
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
name: PHPUnit Tests
on:
push:
branches:
- main
- 'feature/**'
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:9.6
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
strategy:
matrix:
php-version: ['8.1', '8.2', '8.3']
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mysqli, pdo_mysql
coverage: none
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress
- name: Checkout WordPress develop
uses: actions/checkout@v6
with:
repository: WordPress/wordpress-develop
path: wordpress-develop
- name: Checkout database-module
uses: actions/checkout@v6
with:
repository: TangibleInc/database-module
path: database-module
- name: Checkout fields
uses: actions/checkout@v6
with:
repository: TangibleInc/fields
path: fields
- name: Setup WordPress test config
run: |
cp wordpress-develop/wp-tests-config-sample.php wordpress-develop/wp-tests-config.php
sed -i "s/youremptytestdbnamehere/wordpress_test/" wordpress-develop/wp-tests-config.php
sed -i "s/yourusernamehere/root/" wordpress-develop/wp-tests-config.php
sed -i "s/yourpasswordhere/root/" wordpress-develop/wp-tests-config.php
sed -i "s/localhost/127.0.0.1/" wordpress-develop/wp-tests-config.php
- name: Run PHPUnit
env:
WORDPRESS_DEVELOP_DIR: ${{ github.workspace }}/wordpress-develop
DATABASE_MODULE_DIR: ${{ github.workspace }}/database-module
TANGIBLE_FIELDS_DIR: ${{ github.workspace }}/fields
run: ./vendor/bin/phpunit