Remove deprecated --verbose and --coverage-clover flags from PHPUnit … #489
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: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| phpunit: | |
| runs-on: ubuntu-latest | |
| env: | |
| TRAVIS_BUILD_DIR: ${{ github.workspace }} | |
| strategy: | |
| matrix: | |
| php_version: [8.4] | |
| wp_version: [latest, '6.8', '6.9'] | |
| wp_multisite: [0] | |
| include: | |
| - php_version: 8.3 | |
| wp_version: latest | |
| wp_multisite: 1 | |
| services: | |
| mysql: | |
| image: mysql:5.7 | |
| env: | |
| MYSQL_ROOT_PASSWORD: 'root' | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php_version }} | |
| extensions: mysqli | |
| coverage: xdebug | |
| tools: phpunit-polyfills | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ matrix.php_version }}-${{ hashFiles('**/composer.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php-${{ matrix.php_version }}- | |
| - name: Install composer dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Install SVN | |
| run: sudo apt-get install -y subversion | |
| - name: Setup WP | |
| run: script/setup | |
| env: | |
| WP_VERSION: ${{ matrix.wp_version }} | |
| WP_MULTISITE: ${{ matrix.wp_multisite }} | |
| - name: PHPUnit | |
| run: script/cibuild-phpunit | |
| env: | |
| WP_MULTISITE: ${{ matrix.wp_multisite }} | |
| - name: Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.xml | |
| directory: ${{ github.workspace }} | |
| verbose: true | |
| flags: php-${{ matrix.php_version }}, wp-${{ matrix.wp_version }}, multisite-${{ matrix.wp_multisite }} | |
| phpcs: | |
| runs-on: ubuntu-latest | |
| env: | |
| TRAVIS_BUILD_DIR: ${{ github.workspace }} | |
| strategy: | |
| matrix: | |
| php_version: [8.3] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php_version }} | |
| extensions: mysqli | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ matrix.php_version }}-${{ hashFiles('**/composer.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php-${{ matrix.php_version }}- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: phpcs | |
| run: script/cibuild-phpcs | |
| phpstan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| - name: Cache Composer packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-8.4-${{ hashFiles('**/composer.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php-8.4- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: PHPStan | |
| run: bin/phpstan analyse | |
| vendor-autoload: | |
| name: Verify vendor autoload files | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Verify no dev dependencies in committed autoload files | |
| run: | | |
| dev_packages="phpunit|php-coveralls|wpcs|wp-cli|yoast|phpstan|szepeviktor" | |
| for file in vendor/composer/autoload_files.php vendor/composer/autoload_psr4.php vendor/composer/autoload_static.php; do | |
| if grep -qiE "$dev_packages" "$file"; then | |
| echo "::error::$file contains dev dependency references. Run 'script/vendor' and commit the result." | |
| grep -iE "$dev_packages" "$file" | |
| exit 1 | |
| fi | |
| done | |
| echo "Vendor autoload files look clean — no dev dependency references found." |