-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 1.47 KB
/
testing.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
name: Testing
on:
pull_request:
branches:
- development
jobs:
tests:
runs-on: ubuntu-latest
services:
mysql:
# Update the specific version of MySQL to match the version used on your server.
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: 'rootpassword'
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: PHP Setup
uses: shivammathur/setup-php@v2
with:
# Update the specific version of PHP to match the version used on your server.
php-version: '7.4'
- name: Install Node.js 20
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: |
composer install
npm install
npm install @wordpress/scripts --save-dev
- name: Install SVN
run: sudo apt-get update && sudo apt-get install -y subversion
- name: Configure Tests
run: composer test-setup
- name: Verify test setup
run: |
ls -ld /tmp/wordpress-tests-lib
echo $WP_CORE_DIR
echo $WP_TESTS_DIR
- name: Run PHPUnit tests
run: vendor/bin/phpunit --configuration vendor/bcgov/wordpress-utils/phpunit.xml.dist
- name: Run tests
run: |
npm run test