From 986173273f9fbb93a4c0811e93e34a8e492ad770 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Tue, 10 Dec 2024 23:14:52 +0100 Subject: [PATCH] Added a github CI workflow that uploads test coverage to Scrutinizer --- .github/workflows/scrutinize.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/scrutinize.yaml diff --git a/.github/workflows/scrutinize.yaml b/.github/workflows/scrutinize.yaml new file mode 100644 index 0000000..3216e89 --- /dev/null +++ b/.github/workflows/scrutinize.yaml @@ -0,0 +1,31 @@ +name: Generate and upload test coverage +on: + workflow_run: + workflows: ['Lint and Test'] + types: + - completed + +jobs: + scrutinize: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + coverage: xdebug + - name: Cache Composer packages + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} + - name: Generate PHP tests coverage + run: vendor/bin/phpunit --coverage-clover coverage.clover + - name: Upload Scrutinizer coverage + uses: sudo-bot/action-scrutinizer@latest + with: + cli-args: "--repository g/wmde/Time --format=php-clover ./coverage.clover"