Release 9.1 #427
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
name: Test PHP | |
concurrency: | |
group: ${{ github.head_ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
branches: | |
- master | |
- development | |
jobs: | |
code-sniff: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
tools: phpcs, phpcbf | |
- name: Run Composer Install | |
run: composer install --prefer-dist --no-progress --quiet | |
- name: Run PHPCBF | |
run: composer run format | |
# PHPCBF returns exit code 1 when it fixes errors, so we continue letting PHPCS find unfixed issues | |
continue-on-error: true | |
- name: Run PHPCS | |
run: composer run lint | |
continue-on-error: false | |
php-unit: | |
needs: code-sniff | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- 3306/tcp | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
tools: phpunit-polyfills | |
- name: Install WordPress Test Suite | |
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:${{ job.services.mysql.ports['3306'] }} | |
- name: Install composer | |
run: composer install --prefer-dist --no-progress | |
- name: Run PHP Unit | |
run: composer run test |