-
Notifications
You must be signed in to change notification settings - Fork 4
87 lines (69 loc) · 2.24 KB
/
tests.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
86
87
name: Run Tests
on: pull_request
jobs:
test:
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
timeout-minutes: 15
runs-on: ubuntu-latest
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', 'latest' ]
wp: [ 'latest' ]
services:
database:
image: mysql:5.6
env:
MYSQL_ROOT_PASSWORD: wordpress
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
extensions: mysql
coverage: none
- name: Install dependencies
run: composer install --no-interaction --no-progress
- name: Install WordPress and initialize database
run: chmod +x ./tests/bin/install-wp-tests.sh && ./tests/bin/install-wp-tests.sh cf7a_tests root wordpress 127.0.0.1 latest
- name: Run PHP Unit tests
run: composer run test
test-e2e:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
wp: [ '6.0', 'latest' ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer
extensions: mysql
coverage: none
- name: Install dependencies
run: composer install --no-interaction --no-progress
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Installing NPM dependencies
run: npm install
- name: Build
run: npm run build
- name: Starting the WordPress Environment
run: npm run wp-env:start
- name: Running e2e tests
run: npm run test:e2e