Skip to content

Commit

Permalink
Create codacy.yml (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
guibranco authored Mar 19, 2024
1 parent fdecf15 commit 9575e63
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Codacy

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
codacy:
name: Codacy
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- name: Install dependencies
uses: php-actions/composer@v6

- name: PHPUnit Tests
uses: php-actions/phpunit@v3
with:
version: 11
php_version: 8.3
php_extensions: xdebug
coverage_clover: coverage.xml
bootstrap: vendor/autoload.php
args: --coverage-filter src tests
env:
XDEBUG_MODE: coverage

- name: Fix code coverage paths
run: |
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml

0 comments on commit 9575e63

Please sign in to comment.