Skip to content

Commit

Permalink
Merge pull request #1183 from mikepenz/feature/1177
Browse files Browse the repository at this point in the history
Provide optimised class detection skipping globber if not required
  • Loading branch information
mikepenz authored Sep 13, 2024
2 parents 6818a87 + eb0ff63 commit 4bfee4d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
17 changes: 13 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions src/testParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,14 +461,19 @@ async function parseTestCases(
transformedFileName = applyTransformer(r, transformedFileName)
}

let resolvedPath =
failed || (annotatePassed && success)
? await resolvePath(transformedFileName, excludeSources, followSymlink)
: transformedFileName
const githubWorkspacePath = process.env['GITHUB_WORKSPACE']
let resolvedPath: string = transformedFileName
if (failed || (annotatePassed && success)) {
if (fs.existsSync(transformedFileName)) {
resolvedPath = transformedFileName
} else if (githubWorkspacePath && fs.existsSync(`${githubWorkspacePath}${transformedFileName}`)) {
resolvedPath = `${githubWorkspacePath}${transformedFileName}`
} else {
resolvedPath = await resolvePath(transformedFileName, excludeSources, followSymlink)
}
}

core.debug(`Path prior to stripping: ${resolvedPath}`)

const githubWorkspacePath = process.env['GITHUB_WORKSPACE']
if (githubWorkspacePath) {
resolvedPath = resolvedPath.replace(`${githubWorkspacePath}/`, '') // strip workspace prefix, make the path relative
}
Expand Down

0 comments on commit 4bfee4d

Please sign in to comment.