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
21 changes: 20 additions & 1 deletion .github/workflows/action-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ on:
required: false
type: string
default: ""
coverage:
required: false
type: boolean
default: false
secrets:
CODECOV_TOKEN:
required: false

jobs:
phpunit:
Expand All @@ -25,6 +32,8 @@ jobs:
matrix:
mysql_image: ["mysql:8.0", "mariadb:10.11"]
php_version: ["8.2", "8.3"]
env:
COVERAGE: ${{ inputs.coverage && matrix.mysql_image == 'mysql:8.0' && matrix.php_version == '8.3' }}
steps:
- name: Checkout SwagMigrationMagento
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -43,4 +52,14 @@ jobs:
working-directory: custom/plugins/${{ inputs.extension_name }}
run: |
composer dump-autoload --dev
php -d pcov.enabled=1 -d pcov.directory=${PWD}/src -d pcov.exclude='~(vendor|tests|node_modules)~' ${GITHUB_WORKSPACE}/vendor/bin/phpunit --configuration phpunit.xml.dist
php -d pcov.enabled=${{ env.COVERAGE == 'true' && '1' || '0' }} -d pcov.directory=${PWD}/src -d pcov.exclude='~(vendor|tests|node_modules)~' ${GITHUB_WORKSPACE}/vendor/bin/phpunit --configuration phpunit.xml.dist ${{ env.COVERAGE == 'true' && '--coverage-clover clover.xml' || '' }}

- name: Upload coverage to Codecov
if: env.COVERAGE == 'true'
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/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ jobs:
with:
extension_name: ${{ github.event.repository.name }}
platform_branch: trunk
coverage: true
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ src/Resources/public/administration/
src/Resources/public/static/
composer.lock
php-cs-fixer.migration-magento.cache
clover.xml
3 changes: 2 additions & 1 deletion tests/TestBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
} elseif (is_readable(__DIR__ . '/../../../../src/Core/TestBootstrapper.php')) {
require __DIR__ . '/../../../../src/Core/TestBootstrapper.php';
} else {
exit('Could not find TestBootstrapper.php');
fwrite(\STDERR, 'Could not find TestBootstrapper.php' . \PHP_EOL);
exit(1);
}

return (new TestBootstrapper())
Expand Down