Skip to content
Merged
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
38 changes: 31 additions & 7 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
- main
- 'renovate/**'
pull_request:
branches:
- '**'
- '!renovate/**'

jobs:
tests:
Expand Down Expand Up @@ -36,7 +33,6 @@ jobs:
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: ${{ matrix.composer-options }}

# Run tests
- name: Run tests
Expand Down Expand Up @@ -68,21 +64,49 @@ jobs:
- name: Run tests with coverage
run: composer test:coverage

# Report coverage
# Upload artifact
- name: Fix coverage path
working-directory: .build/coverage
run: sed -i 's#/home/runner/work/cpanel-requests/cpanel-requests#${{ github.workspace }}#g' clover.xml
- name: Upload coverage artifact
uses: actions/upload-artifact@v3
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

# Download artifact
- name: Download coverage artifact
id: download
uses: actions/download-artifact@v3
with:
name: coverage

# CodeClimate
- name: CodeClimate report
uses: paambaati/[email protected]
if: env.CC_TEST_REPORTER_ID
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{ github.workspace }}/.build/coverage/clover.xml:clover
${{ steps.download.outputs.download-path }}/clover.xml:clover

# codecov
- name: codecov report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: .build/coverage
files: |
${{ steps.download.outputs.download-path }}/clover.xml
fail_ci_if_error: true
verbose: true