Skip to content

Commit

Permalink
cI: coveralls github action
Browse files Browse the repository at this point in the history
  • Loading branch information
audunru committed May 20, 2024
1 parent 9dbe61e commit b43781a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Release

on:
push:
branches:
- master
branches: [master]

permissions:
contents: write
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}

0 comments on commit b43781a

Please # to comment.