Skip to content

Commit

Permalink
Merge branch 'main' into task/add-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mteu committed Aug 15, 2024
2 parents adf0e51 + 2006e83 commit a64f44f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
50 changes: 23 additions & 27 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,35 @@ jobs:
- name: Run tests
run: composer test

coverage:
name: Test coverage
# Upload artifact
- name: Fix coverage path
working-directory: .build/coverage
run: sed -i 's#/home/runner/work/composer-update-check/composer-update-check#${{ github.workspace }}#g' clover.xml
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: .build/coverage/clover.xml
retention-days: 7

coverage-report:
name: Report test coverage
runs-on: ubuntu-latest
needs: coverage
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Prepare environment
- name: Setup PHP
uses: shivammathur/setup-php@v2
# Download artifact
- name: Download coverage artifact
id: download
uses: actions/download-artifact@v4
with:
php-version: 8.2
tools: composer:v2
coverage: pcov

# Install dependencies
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: highest

# Run Unit tests
- name: Build coverage directory
run: mkdir -p .build/coverage
- name: Run Unit tests with coverage
run: composer test:coverage
name: coverage

# Report coverage
- name: codecov report
uses: codecov/codecov-action@v4
# Coveralls
- name: Coveralls report
uses: coverallsapp/github-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: .build/coverage
fail_ci_if_error: true
verbose: true^
file: ${{ steps.download.outputs.download-path }}/clover.xml
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<div align="center">

[![Coverage Status](https://coveralls.io/repos/github/mteu/typo3-stream-writer/badge.svg)](https://coveralls.io/github/mteu/typo3-stream-writer)

# TYPO3 Stream Writer

</div>
Expand Down

0 comments on commit a64f44f

Please sign in to comment.