diff --git a/.github/workflows/PublishCoverageResults.yml b/.github/workflows/PublishCoverageResults.yml index 73b03ed..fcb3bc7 100644 --- a/.github/workflows/PublishCoverageResults.yml +++ b/.github/workflows/PublishCoverageResults.yml @@ -200,6 +200,7 @@ jobs: - name: 📊 Publish code coverage at CodeCov uses: codecov/codecov-action@v5 + id: codecov if: inputs.codecov continue-on-error: true with: @@ -212,8 +213,18 @@ jobs: - name: 📉 Publish code coverage at Codacy uses: codacy/codacy-coverage-reporter-action@v1 + id: codacy if: inputs.codacy continue-on-error: true with: project-token: ${{ secrets.CODACY_TOKEN }} coverage-reports: ${{ inputs.coverage_report_xml_directory }}/${{ inputs.coverage_report_xml_filename }} + + - name: Generate error messages + run: | + if [[ "${{ steps.codecov.outcome }}" == "failure" ]]; then + printf "::error title=%s::%s\n" "Codecov" "Failed to publish code coverage results." + fi + if [[ "${{ steps.codacy.outcome }}" == "failure" ]]; then + printf "::error title=%s::%s\n" "Codacy" "Failed to publish code coverage results." + fi diff --git a/.github/workflows/PublishOnPyPI.yml b/.github/workflows/PublishOnPyPI.yml index f5e976c..5f17966 100644 --- a/.github/workflows/PublishOnPyPI.yml +++ b/.github/workflows/PublishOnPyPI.yml @@ -50,7 +50,6 @@ on: required: false jobs: - PublishOnPyPI: name: 🚀 Publish to PyPI runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 41b21ac..48e2477 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -74,6 +74,11 @@ on: required: false default: true type: boolean + codecov_flags: + description: 'Flags applied to the upload to Codecov' + required: false + default: 'unittest' + type: string secrets: CODECOV_TOKEN: description: 'Token to push result to Codecov.' @@ -125,13 +130,21 @@ jobs: - name: 📊 Publish unittest results at CodeCov uses: codecov/test-results-action@v1 + id: codecov if: inputs.codecov with: token: ${{ secrets.CODECOV_TOKEN }} disable_search: true files: ${{ inputs.merged_junit_filename }} + flags: ${{ inputs.codecov_flags }} fail_ci_if_error: true + - name: Generate error messages + run: | + if [[ "${{ steps.codecov.outcome }}" == "failure" ]]; then + printf "::error title=%s::%s\n" "Codecov" "Failed to publish unittest results." + fi + - name: 📤 Upload merged 'JUnit Test Summary' artifact uses: pyTooling/upload-artifact@v4 if: inputs.merged_junit_artifact != '' diff --git a/tests/requirements.txt b/tests/requirements.txt index e44d7b6..dc267c1 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -10,4 +10,4 @@ pytest-cov ~= 6.1 # Static Type Checking mypy ~= 1.15 typing_extensions ~= 4.13 -lxml ~= 5.3 +lxml ~= 5.4