forked from afragen/git-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.76 KB
/
Copy pathwp-phpunit.yml
File metadata and controls
59 lines (51 loc) · 1.76 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
# Based on https://github.com/wp-cli/scaffold-command/blob/f9bad3dd7224d5684d950d31c486df70905e386f/templates/plugin-github.mustache
# Thanks Josh https://github.com/Shelob9/wordpress-plugin/blob/main/.github/workflows/wordpress.yml
# Thanks https://github.com/shivammathur
name: WordPress Tests
on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-18.04]
php-versions: ['7.4', '8.0', '8.1']
phpunit-versions: ['9.5.20']
include:
- php-versions: '7.4'
phpunit-versions: '7.5.20'
operating-system: ubuntu-18.04
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
extensions: mysql
tools: wp-cli, phpunit-polyfills, phpunit:${{ matrix.phpunit-versions }}
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check PHP Version
run: php -v
- name: Composer install
run: composer install --optimize-autoloader --prefer-dist
- name: Start Mysql
run: sudo service mysql start
- name: Install WP Tests
run: bash bin/install-wp-tests.sh wordpress_test root root localhost latest
- name: phpunit tests
run: |
echo "define('WP_TESTS_PHPUNIT_POLYFILLS_PATH', '$HOME/.composer/vendor/yoast/phpunit-polyfills');" >> /tmp/wordpress-tests-lib/wp-tests-config.php
/usr/local/bin/phpunit --config=phpunit.xml