Merge pull request #944 from Automattic/dependabot/npm_and_yarn/semve… #291
Workflow file for this run
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: Run PHPUnit and PHPCS | |
on: [push] | |
jobs: | |
test: | |
name: WP ${{ matrix.wordpress }} on PHP ${{ matrix.php }} | |
runs-on: ubuntu-18.04 | |
continue-on-error: ${{ matrix.allowed_failure }} | |
env: | |
WP_VERSION: ${{ matrix.wordpress }} | |
strategy: | |
matrix: | |
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ] | |
wordpress: [ '5.5', '5.6', '5.7', '5.8', '5.9', '6.0', '6.1' ] | |
allowed_failure: [ false ] | |
include: | |
- php: "8.0" | |
# Ignore platform requirements, so that PHPUnit 7.5 can be installed on PHP 8.0 (and above). | |
composer-options: "--ignore-platform-reqs" | |
extensions: pcov | |
ini-values: pcov.directory=., "pcov.exclude=\"~(vendor|tests)~\"" | |
coverage: pcov | |
exclude: | |
- php: '8.0' | |
wordpress: '5.5' | |
fail-fast: false | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up PHP ${{ matrix.php }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: ${{ matrix.extensions }} | |
ini-values: ${{ matrix.ini-values }} | |
coverage: ${{ matrix.coverage }} | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v1 | |
with: | |
composer-options: "${{ matrix.composer-options }}" | |
- name: Setup Problem Matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Show PHP and PHPUnit version info | |
run: | | |
php --version | |
./vendor/bin/phpunit --version | |
- name: Start MySQL service | |
run: sudo /etc/init.d/mysql start | |
- name: Install WordPress environment | |
run: composer prepare ${{ matrix.wordpress }} | |
- name: Run integration tests (single site) | |
run: composer integration | |
- name: Run integration tests (multisite) | |
run: composer integration-ms | |
- name: Run PHPCS | |
run: composer cs |