Lite to pro design update #9067
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
# Trigger the workflow on push or pull request, | |
# but only for the main branch | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [ opened, labeled, synchronize ] | |
name: PHPUnit | |
jobs: | |
build-test: | |
if: contains(github.event.pull_request.labels.*.name, 'run tests') | |
runs-on: ubuntu-20.04 | |
env: | |
WP_MULTISITE: ${{ matrix.multisite }} | |
strategy: | |
matrix: | |
include: | |
- php: 7.4 | |
wordpress: trunk | |
multisite: 0 | |
- php: 8.0 | |
wordpress: trunk | |
multisite: 0 | |
name: PHP ${{ matrix.php }} tests in WP ${{ matrix.wordpress }} | |
steps: | |
- uses: actions/[email protected] | |
# get the PHP version | |
- uses: shivammathur/[email protected] | |
with: | |
php-version: ${{ matrix.php }} | |
tools: phpunit-polyfills | |
- name: Installing WordPress | |
run: | | |
export WP_DEVELOP_DIR=/tmp/wordpress/ | |
git clone --depth=1 --branch="${{ matrix.wordpress }}" git://develop.git.wordpress.org/ /tmp/wordpress | |
cd .. | |
cp -r "${GITHUB_REPOSITORY#*/}" "/tmp/wordpress/src/wp-content/plugins/formidable" | |
cd /tmp/wordpress/ | |
pwd | |
cp wp-tests-config-sample.php wp-tests-config.php | |
sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php | |
sed -i "s/yourusernamehere/root/" wp-tests-config.php | |
sed -i "s/yourpasswordhere/root/" wp-tests-config.php | |
- name: Creating database | |
run: | | |
sudo /etc/init.d/mysql start | |
mysql -u root -proot -e "CREATE DATABASE wordpress_tests;" | |
- name: PhpUnit tests | |
run: | | |
cd "/tmp/wordpress/src/wp-content/plugins/formidable" | |
pwd | |
phpunit --coverage-clover=coverage.xml | |
- name: Send code coverage report to Codecov.io | |
uses: codecov/codecov-action@v2 | |
with: | |
files: /tmp/wordpress/src/wp-content/plugins/formidable/coverage.xml |