Skip to content

Modernize Testing Infrastructure and Theme Structure #27

Modernize Testing Infrastructure and Theme Structure

Modernize Testing Infrastructure and Theme Structure #27

Workflow file for this run

name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: PHP ${{ matrix.php-version }} / WP ${{ matrix.wp-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
wp-version: ['6.4.3', '6.3.5']
steps:
- uses: actions/checkout@v4
- name: Build and run tests
id: phpunit
shell: bash
run: |
{
echo "### PHP ${{ matrix.php-version }} / WordPress ${{ matrix.wp-version }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
docker compose build --build-arg PHP_VERSION=${{ matrix.php-version }} wordpress-test
WP_VERSION=${{ matrix.wp-version }} docker compose run --rm wordpress-test sh -c "composer install && ./vendor/bin/phpunit" | tee >(cat >> $GITHUB_STEP_SUMMARY)
exit ${PIPESTATUS[0]}
} || {
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
exit 1
}
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY