Improvements & string adjustments #1787
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: Test PHP | |
| on: [pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| phplint: | |
| name: PHPCS on PHP 8.0 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup PHP version | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.0' | |
| extensions: simplexml | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Install Composer dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Run PHPCS | |
| run: composer phpcs | |
| phpunit: | |
| name: PHPUnit tests on ${{ matrix.php-versions }} | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: [ '8.0', '8.1', '8.2', '8.3' ] | |
| services: | |
| database: | |
| image: mysql:latest | |
| env: | |
| MYSQL_DATABASE: wordpress_tests | |
| MYSQL_ROOT_PASSWORD: root | |
| ports: | |
| - 3306:3306 | |
| steps: | |
| - name: Setup PHP version | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: simplexml, mysql | |
| tools: phpunit-polyfills:1.1 | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Install WordPress Test Suite | |
| run: composer install-wp-tests | |
| - name: Install Composer dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Run phpunit | |
| run: composer phpunit | |
| phpstan: | |
| name: PHPStan on PHP 8.0 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP version | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.0' | |
| extensions: simplexml, mysql | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Create the build file | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Install Composer dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: PHPStan Static Analysis | |
| run: composer phpstan |