Skip to content

Integration Tests

Integration Tests #303

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: Integration Tests
on:
push:
branches:
- 'develop'
- 'trunk'
- 'master'
pull_request:
branches:
- '**'
# Once weekly on Wednesdays at 05:00 UTC.
schedule:
- cron: '0 5 * * 3'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
php: ['8.1','8.0','7.4','5.6']
wp: ['latest', 'nightly']
include:
# Oldest version that passes the `$token` parameter to session actions:
- php: '7.2'
wp: '4.9'
fail-fast: false
name: "WP ${{ matrix.wp }} / PHP ${{ matrix.php }}"
runs-on: ubuntu-latest
timeout-minutes: 10
services:
mysql:
image: bitnami/mysql:8
ports:
- 3306/tcp
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress_test
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Composer cache
uses: actions/cache@v2
env:
cache-name: cache-composer-dependencies
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Install PHP
uses: shivammathur/setup-php@2.16.0
with:
php-version: ${{ matrix.php }}
extensions: mysqli, xmlwriter
coverage: none
ini-file: development
env:
fail-fast: true
- name: Debugging
run: |
php --version
php -m
composer --version
mysql --version
- name: Install dependencies
run: |
composer remove \
"phpstan/*" \
szepeviktor/phpstan-wordpress \
--dev
composer require --dev --update-with-dependencies --prefer-dist \
roots/wordpress-full="${{ matrix.wp == 'latest' && '*' || (matrix.wp == 'nightly' && 'dev-main' || format('~{0}.0', matrix.wp)) }}"
- name: Run the tests
run: composer test:integration