Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/action-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ on:
platform_branch:
required: true
type: string
coverage:
required: false
type: boolean
default: false
secrets:
CODECOV_TOKEN:
required: false

jobs:
phpunit:
Expand All @@ -32,4 +39,18 @@ jobs:
}

- name: Run PHPUnit
run: composer -d custom/plugins/${{ inputs.extension_name }} run phpunit
run: |
composer -d custom/plugins/${{ inputs.extension_name }} run phpunit -- --log-junit junit.xml ${{ inputs.coverage && '--coverage-clover clover.xml' || '' }}
# PHPUnit writes </testsuites> only once the whole suite has run, so a report without it
# means the process died early (e.g. exit() in code under test) even though it exited 0
grep -q '</testsuites>' custom/plugins/${{ inputs.extension_name }}/junit.xml
Comment thread
jozsefdamokos marked this conversation as resolved.

- name: Upload coverage to Codecov
if: inputs.coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
root_dir: ${{ github.workspace }}/custom/plugins/${{ inputs.extension_name }}
working-directory: ${{ github.workspace }}/custom/plugins/${{ inputs.extension_name }}
files: ./clover.xml
3 changes: 3 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
with:
extension_name: ${{ github.event.repository.name }}
platform_branch: ${{ matrix.shopware-version }}
coverage: ${{ matrix.shopware-version == 'trunk' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

smoke_test:
name: Smoke test
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ node_modules
/src/Resources/app/administration/test/e2e/cypress/results/
/src/Resources/app/administration/test/app/
/src/Resources/public/
junit.xml
clover.xml