-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Full support for Multi module projects (#50)
* Add validation for required inputs * Tech Debt - Adding eslint * Tech Debt - Adding prettier and fixing existing issues * Tech Debt - Removing webpack * Tech Debt - Fixing warnings * Tech Debt - Fixing single quote * Tech Debt - Turning off the dot-notation rule * Tech Debt - Cleaning up test file warnings * Tech Debt - Fixing the context const issue in test files * Send the Modules coverage information to action from process * Passing coverage-changed-files from process * Adding Module table (removed files table temporarily) * Adding Files table back in * Fixing the table formatting issues * Fixing the Files status issue * Render will add PR comment for Single and Multi module * Fixing the action test cases * Testing the glob pattern matching * Testing the glob pattern matching * Using globSync * Logging path * Filtering empty paths * typeof check for path returned * Fixing the path type * Fixing the path type * Debugging the getJsonReports function * Passing array directly to globSync * Replacing globSync with glob * Testing the @actions/glob * Revert "Testing the @actions/glob" This reverts commit f93e18a. * Revert "Replacing globSync with glob" This reverts commit eada1b7. * Revert "Passing array directly to globSync" This reverts commit faa89e8. * Revert "Debugging the getJsonReports function" This reverts commit e581f33. * Revert "Fixing the path type" This reverts commit d62784f. * Revert "typeof check for path returned" This reverts commit 33ad78e * Revert "Filtering empty paths" This reverts commit 6b8f1ae. * Revert "Logging path" This reverts commit 37b3821. * Revert "Using globSync" This reverts commit 575fff8. * Revert "Testing the glob pattern matching" This reverts commit 5345c33. * Using @actions/glob to support wildcards in paths * Deleting webpack.config.js * Adding more debug logs * Running Lint in CI * Improving code coverage * Updating CI to use node16 * Adding test for missing cases * Updating README.md * Updating screenshots
- Loading branch information
1 parent
9a2d796
commit 4a4edd0
Showing
26 changed files
with
14,152 additions
and
6,689 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
env: { | ||
node: true, | ||
es2021: true, | ||
jest: true, | ||
jasmine: true, | ||
}, | ||
extends: ['standard', 'prettier'], | ||
overrides: [ | ||
{ | ||
files: ['.eslintrc.{js, cjs}'], | ||
}, | ||
], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: true, | ||
}, | ||
rules: { | ||
quotes: ['error', 'single', { avoidEscape: true }], | ||
'no-var': ['error'], | ||
'dot-notation': ['off'], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// prettier.config.js, .prettierrc.js, prettier.config.mjs, or .prettierrc.mjs | ||
|
||
/** @type {import("prettier").Options} */ | ||
const config = { | ||
trailingComma: 'es5', | ||
tabWidth: 2, | ||
semi: false, | ||
singleQuote: true, | ||
useTabs: false, | ||
} | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
const action = require('../src/action') | ||
const core = require('@actions/core') | ||
const github = require('@actions/github') | ||
|
||
jest.mock('@actions/core') | ||
jest.mock('@actions/github') | ||
|
||
describe('Input validation', function () { | ||
function getInput(key) { | ||
switch (key) { | ||
case 'paths': | ||
return './__tests__/__fixtures__/report.xml' | ||
case 'token': | ||
return 'SMPLEHDjasdf876a987' | ||
} | ||
} | ||
|
||
const createComment = jest.fn() | ||
const listComments = jest.fn() | ||
const updateComment = jest.fn() | ||
|
||
core.getInput = jest.fn(getInput) | ||
github.getOctokit = jest.fn(() => { | ||
return { | ||
repos: { | ||
compareCommits: jest.fn(() => { | ||
return { | ||
data: { | ||
files: [ | ||
{ | ||
filename: 'src/main/kotlin/com/madrapps/jacoco/Math.kt', | ||
blob_url: | ||
'https://github.com/thsaravana/jacoco-playground/blob/77b14eb61efcd211ee93a7d8bac80cf292d207cc/src/main/kotlin/com/madrapps/jacoco/Math.kt', | ||
}, | ||
{ | ||
filename: | ||
'src/main/java/com/madrapps/jacoco/operation/StringOp.java', | ||
blob_url: | ||
'https://github.com/thsaravana/jacoco-playground/blob/77b14eb61efcd211ee93a7d8bac80cf292d207cc/src/main/java/com/madrapps/jacoco/operation/StringOp.java', | ||
}, | ||
], | ||
}, | ||
} | ||
}), | ||
}, | ||
issues: { | ||
createComment, | ||
listComments, | ||
updateComment, | ||
}, | ||
} | ||
}) | ||
core.setFailed = jest.fn((c) => { | ||
fail(c) | ||
}) | ||
|
||
it('Fail if paths is not present', async () => { | ||
core.getInput = jest.fn((c) => { | ||
switch (c) { | ||
case 'paths': | ||
return '' | ||
default: | ||
return getInput(c) | ||
} | ||
}) | ||
github.context.eventName = 'pull_request' | ||
|
||
core.setFailed = jest.fn((c) => { | ||
expect(c).toEqual("'paths' is missing") | ||
}) | ||
await action.action() | ||
}) | ||
|
||
it('Fail if token is not present', async () => { | ||
core.getInput = jest.fn((c) => { | ||
switch (c) { | ||
case 'token': | ||
return '' | ||
default: | ||
return getInput(c) | ||
} | ||
}) | ||
github.context.eventName = 'pull_request' | ||
|
||
core.setFailed = jest.fn((c) => { | ||
expect(c).toEqual("'token' is missing") | ||
}) | ||
await action.action() | ||
}) | ||
}) |
Oops, something went wrong.