diff --git a/README.md b/README.md index 5790446..653dd6d 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,9 @@ jobs: # Name of the Check Run which will be created name: '' - # Path to test report + # Coma separated list of paths to test reports # Supports wildcards via [fast-glob](https://github.com/mrmlnc/fast-glob) - # Path may match multiple result files of same format + # All matched result files must be of same format path: '' # Format of test report. Supported options: diff --git a/action.yml b/action.yml index 2995c49..7c79941 100644 --- a/action.yml +++ b/action.yml @@ -16,7 +16,10 @@ inputs: description: Name of the check run required: true path: - description: Path to test report + description: | + Coma separated list of paths to test reports + Supports wildcards via [fast-glob](https://github.com/mrmlnc/fast-glob) + All matched files must be of same format required: true reporter: description: | diff --git a/src/main.ts b/src/main.ts index 1ad1a6e..16ae666 100644 --- a/src/main.ts +++ b/src/main.ts @@ -90,14 +90,17 @@ function getParser(reporter: string): ParseTestResult { } export async function getFiles(pattern: string): Promise { - const paths = await glob(pattern, {dot: true}) - return Promise.all( + const paths = (await Promise.all(pattern.split(',').map(async pat => glob(pat, {dot: true})))).flat() + + const files = Promise.all( paths.map(async path => { core.info(`Reading test report '${path}'`) const content = await fs.promises.readFile(path, {encoding: 'utf8'}) return {path, content} }) ) + + return files } run()