Merge pull request #1202 from Automattic/dependabot/github_actions/ac… #121
This file contains hidden or 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: Integration Tests | |
| on: | |
| pull_request: | |
| paths: | |
| - '**.php' | |
| - 'composer.json' | |
| - 'composer.lock' | |
| - 'phpunit.xml.dist' | |
| - '.wp-env.json' | |
| - '.github/workflows/integration.yml' | |
| push: | |
| branches: | |
| - develop | |
| - main | |
| paths: | |
| - '**.php' | |
| - 'composer.json' | |
| - 'composer.lock' | |
| - 'phpunit.xml.dist' | |
| - '.wp-env.json' | |
| - '.github/workflows/integration.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: WP ${{ matrix.wordpress }} on PHP ${{ matrix.php }} | |
| runs-on: ubuntu-latest | |
| continue-on-error: ${{ matrix.allowed_failure || false }} | |
| env: | |
| WP_VERSION: ${{ matrix.wordpress }} | |
| strategy: | |
| matrix: | |
| include: | |
| # Check lowest supported WP version, with the lowest supported PHP. | |
| - wordpress: '6.4' | |
| php: '7.4' | |
| allowed_failure: false | |
| # Check latest WP with the latest PHP (may fail due to bleeding edge changes). | |
| - wordpress: 'master' | |
| php: 'latest' | |
| allowed_failure: true | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install wordpress environment | |
| run: npm install -g @wordpress/env | |
| - name: Set up PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: ${{ matrix.extensions }} | |
| ini-values: ${{ matrix.ini-values }} | |
| coverage: ${{ matrix.coverage }} | |
| - name: Install Composer dependencies | |
| uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # 3.1.1 | |
| with: | |
| composer-options: --ignore-platform-req=php+ | |
| - name: Set up problem matchers for PHP | |
| run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
| - name: Set up problem matchers for PHPUnit | |
| run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
| - name: Show PHP and PHPUnit version info | |
| run: | | |
| php --version | |
| ./vendor/bin/phpunit --version | |
| - name: Setup wp-env | |
| run: wp-env start | |
| env: | |
| WP_ENV_CORE: WordPress/WordPress#${{ matrix.wordpress }} | |
| - name: Run integration tests (single site) | |
| run: composer test:integration | |
| - name: Run integration tests (multisite) | |
| run: composer test:integration-ms |