From 8cb6ade3acaef17fc9ea430b4c5500ff69abe723 Mon Sep 17 00:00:00 2001 From: Martin Fillafer Date: Mon, 20 Mar 2023 15:29:56 +0100 Subject: [PATCH] test: directory mapping --- .github/workflows/test-report.yml | 2 ++ action.yml | 5 +++++ src/main.ts | 3 +++ 3 files changed, 10 insertions(+) diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml index 1cf8442..ed3f0db 100644 --- a/.github/workflows/test-report.yml +++ b/.github/workflows/test-report.yml @@ -18,3 +18,5 @@ jobs: name: Workflow Report path: '*.xml' reporter: jest-junit + directory-mapping: + from/path: to/something/else diff --git a/action.yml b/action.yml index 37c1637..b41fcbc 100644 --- a/action.yml +++ b/action.yml @@ -68,6 +68,11 @@ inputs: Detailed listing of test suites and test cases will be skipped. default: 'false' required: false + directory-mapping: + description: | + Map part of the file paths to something else, so they match the paths of the repository. + This is needed when you use run your code in a container with a different path than the source code repository. + required: false token: description: GitHub Access Token required: false diff --git a/src/main.ts b/src/main.ts index c4e8f9a..2557c5f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,6 +44,7 @@ class TestReporter { readonly workDirInput = core.getInput('working-directory', {required: false}) readonly onlySummary = core.getInput('only-summary', {required: false}) === 'true' readonly token = core.getInput('token', {required: true}) + readonly directoryMapping = core.getInput('directory-mapping', {required: true}) readonly octokit: InstanceType readonly context = getCheckRunContext() @@ -64,6 +65,8 @@ class TestReporter { core.setFailed(`Input parameter 'max-annotations' has invalid value`) return } + + console.log('Directory mapping: ', this.directoryMapping) } async run(): Promise {