Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: cleanup unit test coverage #781

Closed
wants to merge 2 commits into from
Closed
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
16 changes: 8 additions & 8 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ jobs:
run: php ./tempest discovery:status

- name: Execute tests
run: vendor/bin/phpunit --coverage-clover build/reports/clover.xml
run: vendor/bin/phpunit

# Only upload coverage once.
- if: matrix.php == '8.3' && matrix.database == 'sqlite' && matrix.os == 'ubuntu-latest' && matrix.stability == 'prefer-stable'
name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
file: build/reports/clover.xml
# # Only upload coverage once.
# - if: matrix.php == '8.3' && matrix.database == 'sqlite' && matrix.os == 'ubuntu-latest' && matrix.stability == 'prefer-stable'
# name: Coveralls
# uses: coverallsapp/github-action@v2
# with:
# github-token: '${{ secrets.GITHUB_TOKEN }}'
# file: build/reports/clover.xml
34 changes: 33 additions & 1 deletion .github/workflows/isolated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,36 @@ jobs:
composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Execute tests
run: phpunit -c "src/Tempest/${{ matrix.package.basename }}/phpunit.xml"
run: phpunit -c "src/Tempest/${{ matrix.package.basename }}/phpunit.xml" --coverage-clover build/reports/clover.xml

# Only upload coverage once
- if: matrix.php == '8.3' && matrix.os == 'ubuntu-latest' && matrix.stability == 'prefer-stable'
name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: build/reports/clover.xml
flag-name: "Unit-${{ matrix.package.name }}"

finish:
needs:
- get_packages
- phpunit
runs-on: ubuntu-latest
steps:
- name: Get Package Flags
id: get-package-flags
run: |
packages=$(echo '${{ needs.get_packages.outputs.matrix }}' | jq -r '.[].name')

# Prepend "Unit-" to each .name value and join with commas
result=$(for package in $packages; do echo -n "Unit-$package,"; done | sed 's/,$//')

echo "Result: $result"

echo "packages=$result" >> $GITHUB_OUTPUT
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: ${{ steps.get-package-flags.outputs.packages }}
Loading