Skip to content

Commit

Permalink
clean(ZMS): upload coverage files
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Fink authored and Thomas Fink committed Feb 10, 2025
1 parent 6a3d439 commit ca1a5a9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 22 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/combined-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,21 @@ jobs:
needs: [call-php-unit-tests]
runs-on: ubuntu-latest
steps:
- name: List available artifacts
run: |
echo "Available artifacts in all-coverage:"
ls -la all-coverage/ || echo "all-coverage directory not found"
- name: Download all coverage reports
uses: actions/download-artifact@v4
with:
path: all-coverage
merge-multiple: true
- name: Combine reports
run: |
mkdir -p combined-coverage
for module in zmsadmin zmscalldisplay zmscitizenapi zmsdldb zmsentities zmsmessaging zmsslim zmsstatistic zmsticketprinter zmsapi zmsdb zmsclient; do
if [ -d "all-coverage/coverage-$module" ]; then
mkdir -p "combined-coverage/$module"
cp -r "all-coverage/coverage-$module"/* "combined-coverage/$module/"
fi
done
- name: Upload combined coverage
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: combined-coverage/
retention-days: 7

- name: List downloaded artifacts
run: |
echo "Downloaded artifacts:"
ls -la all-coverage/
call-php-build-images:
needs: check-and-proceed
if: |
Expand Down
32 changes: 25 additions & 7 deletions .github/workflows/php-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ jobs:
run: |
cd "${{ matrix.module }}"
mkdir -p coverage
php -dxdebug.mode=coverage \
-dxdebug.start_with_request=yes \
./vendor/bin/phpunit --coverage-html coverage/html --coverage-clover coverage/clover.xml
echo "Running tests with coverage for ${{ matrix.module }}"
php -dzend_extension=xdebug.so -dxdebug.mode=coverage -dmemory_limit=-1 \
./vendor/bin/phpunit \
--coverage-html coverage/html \
--coverage-clover coverage/clover.xml
--log-junit coverage/junit.xml
echo "Coverage files generated:"
ls -la coverage/
- name: Upload Coverage
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -133,8 +138,14 @@ jobs:
echo "Importing test data..."
vendor/bin/importTestData --commit
mkdir -p coverage
php -dzend_extension=xdebug.so -dmemory_limit=-1 vendor/bin/phpunit \
--coverage-html coverage/html --coverage-clover coverage/clover.xml
echo "Running tests with coverage"
php -dzend_extension=xdebug.so -dxdebug.mode=coverage -dmemory_limit=-1 \
./vendor/bin/phpunit \
--coverage-html coverage/html \
--coverage-clover coverage/clover.xml
--log-junit coverage/junit.xml
echo "Coverage files generated:"
ls -la coverage/
- name: Upload Coverage
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -191,11 +202,14 @@ jobs:
cd zmsdb
bin/importTestData --commit
mkdir -p coverage
echo "Running tests with coverage"
php -dzend_extension=xdebug.so -dmemory_limit=-1 vendor/bin/phpunit \
-v --colors=never --coverage-text \
--coverage-html coverage/html \
--coverage-clover coverage/clover.xml \
--log-junit coverage/junit.xml
echo "Coverage files generated:"
ls -la coverage/
- name: Upload Coverage
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -242,8 +256,12 @@ jobs:
mkdir -p coverage
docker-compose up -d
docker-compose exec -T test php -dzend_extension=xdebug.so -dmemory_limit=-1 \
./vendor/bin/phpunit --coverage-html coverage/html --coverage-clover coverage/clover.xml
./vendor/bin/phpunit \
--coverage-html coverage/html \
--coverage-clover coverage/clover.xml \
--log-junit coverage/junit.xml
echo "Coverage files generated:"
ls -la coverage/
- name: Upload Coverage
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit ca1a5a9

Please sign in to comment.