Allow disabling the publishing of test reports via Dorny Test Reporter.

This commit is contained in:
Patrick Lehmann
2024-11-22 22:11:19 +01:00
parent edca070047
commit bc876f7171
3 changed files with 10 additions and 4 deletions

View File

@@ -83,7 +83,7 @@ on:
windows_image: windows_image:
description: 'The used GitHub Action image for Windows based jobs.' description: 'The used GitHub Action image for Windows based jobs.'
required: false required: false
default: 'windows-latest' default: 'windows-2022'
type: string type: string
macos_intel_image: macos_intel_image:
description: 'The used GitHub Action image for macOS (Intel x86-64) based jobs.' description: 'The used GitHub Action image for macOS (Intel x86-64) based jobs.'
@@ -93,7 +93,7 @@ on:
macos_arm_image: macos_arm_image:
description: 'The used GitHub Action image for macOS (ARM aarch64) based jobs.' description: 'The used GitHub Action image for macOS (ARM aarch64) based jobs.'
required: false required: false
default: 'macos-latest' default: 'macos-14'
type: string type: string
outputs: outputs:

View File

@@ -40,6 +40,11 @@ on:
required: false required: false
default: '"--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit"' default: '"--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit"'
type: string type: string
publish:
description: 'Publish test report summary via Dorny Test-Reporter'
required: false
default: true
type: boolean
report_title: report_title:
description: 'Title of the summary report in the pipeline''s sidebar' description: 'Title of the summary report in the pipeline''s sidebar'
required: false required: false
@@ -80,6 +85,7 @@ jobs:
- name: 📊 Publish Unit Test Results - name: 📊 Publish Unit Test Results
uses: dorny/test-reporter@v1 uses: dorny/test-reporter@v1
if: inputs.publish && inputs.report_title != ''
with: with:
name: ${{ inputs.report_title }} name: ${{ inputs.report_title }}
path: Unittesting.xml path: Unittesting.xml

View File

@@ -8,7 +8,7 @@ print(f"Python: {version}")
def loadRequirementsFile(requirementsFile: Path): def loadRequirementsFile(requirementsFile: Path):
requirements = [] requirements = []
with requirementsFile.open("r") as file: with requirementsFile.open("r", encoding="utf-8") as file:
for line in file.readlines(): for line in file.readlines():
line = line.strip() line = line.strip()
if line.startswith("#") or line.startswith("https") or line == "": if line.startswith("#") or line.startswith("https") or line == "":
@@ -84,7 +84,7 @@ for dependency in dependencies:
# Write jobs to special file # Write jobs to special file
github_output = Path(getenv("GITHUB_OUTPUT")) github_output = Path(getenv("GITHUB_OUTPUT"))
print(f"GITHUB_OUTPUT: {github_output}") print(f"GITHUB_OUTPUT: {github_output}")
with github_output.open("a+") as f: with github_output.open("a+", encoding="utf-8") as f:
f.write(f"pacboy_packages={' '.join(pacboyPackages)}\n") f.write(f"pacboy_packages={' '.join(pacboyPackages)}\n")
print(f"GITHUB_OUTPUT:") print(f"GITHUB_OUTPUT:")