diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e3ddf2e..9f922e8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,12 +17,23 @@ jobs: with: php-version: 8.2 tools: composer:v2 + coverage: xdebug - name: "Install composer dependencies" run: composer install --prefer-dist --no-progress - - name: "Run unit tests" - run: composer test:unit + - name: "Run unit tests with coverage" + run: composer run test:coverage + + - name: "Send coverage to Coveralls" + env: + COVERALLS_REPO_TOKEN: ${{ github.token }} + if: ${{ env.COVERALLS_REPO_TOKEN && matrix.coverage }} + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ env.COVERALLS_REPO_TOKEN }} + flag-name: "Unit" + allow-empty: false wp-test: name: "WordPress tests with WP ${{ matrix.wp_version }}" @@ -31,9 +42,6 @@ jobs: strategy: matrix: wp_version: ["6.3", "6.4", "6.5", "6.6", "6.7", "latest"] - include: - - wp_version: "6.7" - coverage: true services: mysql: @@ -56,7 +64,7 @@ jobs: with: php-version: 8.2 tools: composer:v2 - coverage: ${{ matrix.coverage && 'xdebug' || 'none' }} + coverage: none - name: "Install composer dependencies" run: composer install --prefer-dist --no-progress @@ -73,19 +81,4 @@ jobs: run: ./config/scripts/install-wp-tests.sh wordpress_test root '' 127.0.0.1:3306 ${{ matrix.wp_version }} - name: "Run WordPress tests" - if: ${{ !matrix.coverage }} run: composer run test:wordPress - - - name: "Run WordPress tests with coverage" - if: ${{ matrix.coverage }} - run: composer run test:coverage - - - name: "Send coverage to Coveralls" - env: - COVERALLS_REPO_TOKEN: ${{ github.token }} - if: ${{ env.COVERALLS_REPO_TOKEN && matrix.coverage }} - uses: coverallsapp/github-action@v2 - with: - github-token: ${{ env.COVERALLS_REPO_TOKEN }} - flag-name: "Unit" - allow-empty: false diff --git a/composer.json b/composer.json index f5755d1..d93fc6f 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "phpstan": "vendor/bin/phpstan analyse -c phpstan.neon", "test:unit": "vendor/bin/phpunit --no-coverage", "test:wordPress": "vendor/bin/phpunit -c phpunit-wp.xml --no-coverage", - "test:coverage": "vendor/bin/phpunit -c phpunit-wp.xml", + "test:coverage": "vendor/bin/phpunit", "csFixer": "vendor/bin/php-cs-fixer fix --verbose --diff --dry-run", "fix:csFixer": "vendor/bin/php-cs-fixer fix" }