Update dealerdirect/phpcodesniffer-composer-installer requirement from ^1.1 to ^1.2 #105
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: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/ci.yml" | |
| - "**.php" | |
| - "composer.json" | |
| - "composer.lock" | |
| - "phpcs.xml.dist" | |
| - "phpstan.neon.dist" | |
| - "phpunit.xml.dist" | |
| types: [ready_for_review, synchronize, opened] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| typo: | |
| runs-on: ubuntu-latest | |
| name: Typo | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Check spelling | |
| uses: crate-ci/typos@v1.36.2 | |
| lint: | |
| runs-on: ubuntu-latest | |
| name: Lint | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "7.4" | |
| - name: Install PHP dependencies | |
| uses: ramsey/composer-install@v3 | |
| - name: Check PSR-4 mapping | |
| run: composer dump-autoload --dev --optimize --strict-psr | |
| - name: Check code style | |
| run: composer lint | |
| analyze: | |
| runs-on: ubuntu-latest | |
| name: Analyze | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "7.4" | |
| - name: Install PHP dependencies | |
| uses: ramsey/composer-install@v3 | |
| - name: Analyze source code | |
| run: composer analyze | |
| test: | |
| runs-on: ubuntu-latest | |
| name: Test | |
| needs: [typo, lint, analyze] | |
| env: | |
| WP_DB_TEST_NAME: wp_test | |
| WP_DB_TEST_PASS: wp_test | |
| WP_DB_TEST_USER: wp_test | |
| PHP_EXTENSIONS: mysqli | |
| strategy: | |
| fail-fast: true | |
| max-parallel: 2 | |
| matrix: | |
| php-version: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] | |
| wp-version: ["5.*", "6.*"] | |
| services: | |
| database: | |
| image: "mariadb:10.11.5" | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_DATABASE: ${{ env.WP_DB_TEST_NAME }} | |
| MYSQL_USER: ${{ env.WP_DB_TEST_USER }} | |
| MYSQL_PASSWORD: ${{ env.WP_DB_TEST_PASS }} | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup PHP extensions cache environment | |
| id: php-ext-cache | |
| uses: shivammathur/cache-extensions@v1 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: ${{ env.PHP_EXTENSIONS }} | |
| key: php-${{ matrix.php-version }}-ext | |
| - name: Setup PHP extensions cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.php-ext-cache.outputs.dir }} | |
| key: ${{ steps.php-ext-cache.outputs.key }} | |
| restore-keys: ${{ steps.php-ext-cache.outputs.key }} | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: ${{ env.PHP_EXTENSIONS }} | |
| - name: Require PHP dependencies | |
| run: composer require "wp-phpunit/wp-phpunit:${{ matrix.wp-version }}" "roots/wordpress:${{ matrix.wp-version }}" --no-interaction --no-update --dev | |
| - name: Install PHP dependencies | |
| uses: ramsey/composer-install@v3 | |
| - name: Run test | |
| run: vendor/bin/phpunit --coverage-clover coverage.xml | |
| env: | |
| WP_DB_TEST_HOST: 127.0.0.1:${{ job.services.database.ports['3306'] }} | |
| WP_ENVIRONMENT_TYPE: development | |
| - name: Upload coverage to Codecov | |
| if: ${{ matrix.php-version == '8.4' && matrix.wp-version == '6.*' }} | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |