diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..deda38e --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,31 @@ +name: Coverage + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup PHP with PECL extension + uses: shivammathur/setup-php@v2 + with: + php-version: "8.2" + # Taken from https://github.com/kirschbaum-development/laravel-test-runner-container/blob/master/8.2/Dockerfile + extensions: mbstring, mysql, xml, xsl, zip, curl, bcmath, intl, bz2 + + - name: Install composer dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + + - name: Test PHP code + run: composer test-with-coverage + + - name: Upload coverage results to Coveralls + uses: coverallsapp/github-action@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfd5974..4e9cfde 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,7 @@ name: Release on: push: - branches: - - master + branches: [master] permissions: contents: write diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c8daa3e..019b4e9 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -37,10 +37,3 @@ jobs: - name: Validate PHP code run: composer verify - - - name: Upload coverage results to Coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - composer global require php-coveralls/php-coveralls - php-coveralls --coverage_clover=build/logs/clover.xml -v diff --git a/composer.json b/composer.json index ac5ef0f..105f6d5 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "verify": [ "php ./vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php --dry-run", "php ./vendor/bin/phpmd src ansi phpmd-ruleset.xml", - "XDEBUG_MODE=coverage php ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml" + "php ./vendor/bin/phpunit" ] } }