wp-now update to 0.1.74 #683
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: PHPUnit | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**.txt' | |
- '.github/config.json' | |
- 'bin/**' | |
- '.gitignore' | |
- 'docs/**' | |
merge_group: | |
# This allows a subsequently queued workflow run to interrupt previous runs | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
file-diff: | |
runs-on: ubuntu-22.04 | |
name: File Diff | |
if: startsWith( github.repository, 'elementor/' ) | |
outputs: | |
php_diff: ${{ steps.php_diff_files.outputs.diff }} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Check PHP files diff | |
id: php_diff_files | |
uses: technote-space/get-diff-action@v6 | |
with: | |
PATTERNS: | | |
**/*.php | |
composer.+(json|lock) | |
.github/**/*.yml | |
install-wp-tests.sh | |
test: | |
runs-on: ubuntu-22.04 | |
needs: [ 'file-diff' ] | |
if: ${{ github.event.pull_request.title == null || needs.file-diff.outputs.php_diff }} | |
strategy: | |
fail-fast: false | |
matrix: | |
wordpress_versions: ['nightly', 'latest', '6.5', '6.4', '6.3'] | |
php_versions: ['7.4', '8.0'] | |
name: PHPUnit - WordPress ${{ matrix.wordpress_versions }} - PHP version ${{ matrix.php_versions }} | |
env: | |
WP_TESTS_DIR: /tmp/wordpress-tests-lib | |
COVERAGE: ${{ matrix.php_versions >= 8.0 && matrix.wordpress_versions == 'latest' }} | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- 3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php_versions }} | |
coverage: none | |
- name: Install Dependencies | |
run: | | |
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:${{ job.services.mysql.ports['3306'] }} ${{ matrix.wordpress_versions }} true | |
composer update --no-interaction | |
- name: Run Tests with Coverage (latest PHP & WP) | |
if: ${{ env.COVERAGE != 'false' }} | |
run: | | |
composer run coverage | |
- name: Run Tests without Coverage | |
if: ${{ env.COVERAGE == 'false' }} | |
run: | | |
composer run test | |
- name: Run Test - Multisite | |
run: | | |
WP_MULTISITE=1 | |
composer update --no-interaction | |
composer run test | |
test-result: | |
needs: test | |
if: ${{ always() }} # Will be run even if 'test' matrix will be skipped | |
runs-on: ubuntu-20.04 | |
name: PHPUnit - Test Results | |
steps: | |
- name: Test status | |
run: echo "Test status is - ${{ needs.test.result }}" | |
- name: Check test matrix status | |
if: ${{ needs.test.result != 'success' && needs.test.result != 'skipped' }} | |
run: exit 1 |