Skip to content

PHPStorm config

PHPStorm config #461

Workflow file for this run

name: PHPUnit
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
pull_request:
types: [ opened, labeled, synchronize ]
jobs:
build-test:
if: contains(github.event.pull_request.labels.*.name, 'run tests')
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- php: 7.4
wordpress: master
- php: 8.0
wordpress: master
name: PHP ${{ matrix.php }} tests in WP ${{ matrix.wordpress }}
steps:
- uses: actions/checkout@v3.5.3
# get the PHP version
- uses: shivammathur/setup-php@2.25.5
with:
php-version: ${{ matrix.php }}
- name: Installing WordPress
run: |
export WP_DEVELOP_DIR=/tmp/wordpress/
git clone --depth=50 --branch="${{ matrix.wordpress }}" git://develop.git.wordpress.org/ /tmp/wordpress
cd ..
cp -r "${GITHUB_REPOSITORY#*/}" "/tmp/wordpress/src/wp-content/plugins/${GITHUB_REPOSITORY#*/}"
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/${GITHUB_REPOSITORY#*/}"
pwd
composer install
composer dump-autoload --dev
vendor/phpunit/phpunit/phpunit --configuration phpunit.xml