Skip to content

Create integration-test.yml #1

Create integration-test.yml

Create integration-test.yml #1

name: 'Integration Test'
on:
push:
branches: [main, develop, release, release/*]
tags: [ test, phpunit ]
pull_request:
branches: [main, develop, release, release/*]
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.1', '7.0', '5.6']
include:
- php-versions: '7.1'
wp-version: 'latest'
- php-versions: '7.0'
wp-version: 'latest'
- php-versions: '5.6'
wp-version: '4.4'
- php-versions: '5.6'
wp-version: 'latest'
- php-versions: '5.6'
wp-version: 'trunk'
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress_test
ports:
- 3306:3306
options: --health-cmd='mysqladmin ping' --health-interval=10s --health-timeout=10s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer install --prefer-dist --no-progress --no-suggest
- name: Prepare for Test Suite
if: matrix.wp-version != ''
run: |
bash bin/install-wp-tests.sh wordpress_test root 'password' 127.0.0.1 ${{ matrix.wp-version }}
composer global require "phpunit/phpunit=4.8.*|5.7.*"
- name: Run PHPUnit Tests
if: matrix.wp-version != ''
run: |
phpunit
WP_MULTISITE=1 phpunit