diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00deb60..094e131 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['8.0', '8.1', '8.3', '8.4'] + include: + - php: '8.2' + coverage: 'true' name: PHP ${{ matrix.php }} tests steps: @@ -19,31 +22,27 @@ jobs: with: php-version: ${{ matrix.php }} extensions: mbstring, json - coverage: xdebug + coverage: ${{ matrix.coverage && 'xdebug' || 'none' }} - name: Install dependencies - run: composer install - - - name: Prepare codeclimate test reporter - if: ${{ matrix.php == '8.2' }} - run: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build - - - name: Execute tests - run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --testdox - - - name: Upload the reports to coveralls.io - if: ${{ matrix.php == '8.2' }} - run: | - composer global require php-coveralls/php-coveralls - php-coveralls -v - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: composer update --no-interaction - name: Upload the reports to codeclimate - if: ${{ matrix.php == '8.2' }} - run: sudo ./cc-test-reporter after-build -r $CC_TEST_REPORTER_ID + if: ${{ matrix.coverage }} env: + XDEBUG_MODE: coverage CC_TEST_REPORTER_ID: 5e32818628fac9eb11d34e2b35289f88169610cc4a98c6f170c74923342284f1 + uses: paambaati/codeclimate-action@v9 + with: + coverageCommand: | + ./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --testdox + + - name: Upload the reports to coveralls.io + if: ${{ matrix.coverage }} + env: + COVERALLS_REPO_TOKEN: ${{ github.token }} + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ env.COVERALLS_REPO_TOKEN }} + flag-name: Unit + allow-empty: false