Skip to content

Unit Tests on Nightly #149

Unit Tests on Nightly

Unit Tests on Nightly #149

Workflow file for this run

name: Unit Tests on Nightly
on:
# Once weekly on Mondays at 06:00 UTC.
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
fail-fast: false
name: WP nightly / PHP ${{ matrix.php }}
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, xmlwriter
coverage: none
tools: composer:v2
- name: Debugging
run: |
php --version
php -m
composer --version
mysql --version
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}
- name: Install PHP Dependencies
run: |
composer install --prefer-dist --no-progress --no-suggest --no-interaction --ignore-platform-reqs
composer require --dev --update-with-all-dependencies --prefer-dist roots/wordpress="dev-main" roots/wordpress-no-content="dev-main" wp-phpunit/wp-phpunit="dev-master"
- name: Run the tests
run: |
sudo systemctl start mysql.service
composer test:ut
env:
MYSQL_DATABASE: wordpress
WP_TESTS_DB_PASS: root