From 4276c65a6cd807899eb1a8f2c5c3aedf20259375 Mon Sep 17 00:00:00 2001 From: Scion Date: Thu, 1 Jan 2026 17:05:38 -0800 Subject: [PATCH] Added test results json. --- npm/npm-test/action.yaml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/npm/npm-test/action.yaml b/npm/npm-test/action.yaml index 6d05b58..7eba525 100644 --- a/npm/npm-test/action.yaml +++ b/npm/npm-test/action.yaml @@ -13,6 +13,18 @@ inputs: description: "Command to run tests. Default: npm test" required: false default: "npm test" + uploadTestResults: + description: "Whether to upload test results artifacts. Values: true, false." + required: false + default: "true" + testResultsFile: + description: "Path to test results file (relative to workingDirectory). Default: test-results.json" + required: false + default: "test-results.json" + testResultsArtifactName: + description: "Name of the test results artifact to upload. Default: test-results" + required: false + default: "test-results" uploadCoverage: description: "Whether to upload coverage artifacts. Values: true, false." required: false @@ -21,7 +33,7 @@ inputs: description: "Directory for the coverage output. Default: coverage" required: false default: "coverage" - artifactName: + coverageArtifactName: description: "Name of the coverage artifact to upload. Default: coverage" required: false default: "coverage" @@ -46,11 +58,19 @@ runs: run: ${{ inputs.testCommand }} working-directory: ${{ inputs.workingDirectory }} shell: bash + - name: "Upload test results" + if: ${{ inputs.uploadTestResults == 'true' && always() }} + uses: https://github.com/ChristopherHX/gitea-upload-artifact@v4 + with: + name: ${{ inputs.testResultsArtifactName }} + path: ${{ inputs.workingDirectory }}/${{ inputs.testResultsFile }} + if-no-files-found: warn + retention-days: ${{ inputs.retention-days }} - name: "Upload coverage artifacts" if: ${{ inputs.uploadCoverage == 'true' && always() }} uses: https://github.com/ChristopherHX/gitea-upload-artifact@v4 with: - name: ${{ inputs.artifactName }} + name: ${{ inputs.coverageArtifactName }} path: ${{ inputs.workingDirectory }}/${{ inputs.coverageDirectory }} if-no-files-found: warn retention-days: ${{ inputs.retention-days }}