-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (45 loc) · 1.38 KB
/
php-tests.yml
File metadata and controls
56 lines (45 loc) · 1.38 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
name: PHPUnit Tests
on: [ push ]
jobs:
test:
strategy:
matrix:
php_ver:
- "7.4"
wp_ver:
- "latest"
wc_ver:
- "latest"
- "4.8.1"
runs-on: ubuntu-latest
steps:
- name: Checkout the files
uses: actions/checkout@v2
# PHPUnit errors with latest PHP 8.X build.
# This specifically sets PHP version to 7.4.
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: phpunit
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- name: Install dependencies
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php_ver }}
version: 2
- name: Start MySQL
run: sudo /etc/init.d/mysql start
- name: Run install-wp-tests.sh
run: ./vendor/bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wp_ver }}
- name: Run install-woocommerce.sh
run: sudo ./tests/bin/install-woocommerce.sh ${{ matrix.wc_ver }}
- name: Run phpunit
run: ./vendor/bin/phpunit -c phpunit.xml
env:
WP_TESTS_DIR: "/tmp/wordpress-tests-lib"
WC_VERSION: ${{ matrix.wc_ver }}