From 774ea7970e32cd1983d1fb57a41e1f43cc769347 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 7 Dec 2021 20:09:11 +0100 Subject: [PATCH] Added input parameter to the template and documented in the README. --- .github/workflows/PublishTestResults.yml | 8 +++++++- ExamplePipeline.yml | 3 +++ README.md | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 1b551e4..670e3b0 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -24,6 +24,12 @@ name: Publish Unit Test Results on: workflow_call: + inputs: + report_files: + description: 'Pattern of report files to upload. Can be a comma separated list.' + required: false + default: 'artifacts/**/*.xml' + type: string jobs: PublishTestResults: @@ -44,5 +50,5 @@ jobs: uses: dorny/test-reporter@v1 with: name: Unit Test Results - path: artifacts/**/*.xml + path: ${{ inputs.report_files }} reporter: java-junit diff --git a/ExamplePipeline.yml b/ExamplePipeline.yml index 4976b46..3e56ced 100644 --- a/ExamplePipeline.yml +++ b/ExamplePipeline.yml @@ -53,6 +53,9 @@ jobs: uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@main needs: - UnitTesting + with: + # Optional + report_files: artifacts/**/*.xml Package: uses: pyTooling/Actions/.github/workflows/Package.yml@main diff --git a/README.md b/README.md index de87c38..94e0902 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ As shown in the screenshot above, the expected order is: - [Release](.github/workflows/Release.yml): publish GitHub Release. - [Package](.github/workflows/Package.yml): generate source and wheel packages, and upload them as an artifact. - [PublishOnPyPI](.github/workflows/PublishOnPyPI.yml): publish source and wheel packages to PyPI. + - [PublishTestResults](.github/workflows/PublishTestResults.yml): publish unit test results through GH action `dorny/test-reporter`. - Documentation: - [BuildTheDocs](.github/workflows/BuildTheDocs.yml): build Sphinx documentation with BuildTheDocs, and upload HTML as an artifact.