Forked from mattallty/jest-github-action.
I want to sincerely thank mattallty for their initial work on the Jest Github Action. Their effort laid the groundwork for what we have achieved, and I am truly grateful for that.
Using their repository as a starting point has enabled us to enhance the action with new features. I appreciate the opportunity to build upon their work and improve it further.
A big thank you goes to mattallty for their invaluable contribution. Their original work has been essential to our project's development.
Main features:
- Add status checks with code annotations to your pull requests
- Comment your pull requests with code coverage table (if tests succeeded)
You can now consume the action by referencing the v1 branch
uses: EkoCommunications/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
By default, this action will execute npm test
to run your tests.
You can change this behavior by providing a custom test-command
like this:
uses: EkoCommunications/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# this is just an example, this could be any command that will trigger jest
test-command: "yarn test"
uses: EkoCommunications/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Runs tests related to the changes since the base branch of your pull request
# Default to false if not set
changes-only: true
uses: EkoCommunications/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# code coverage will be reported, when this parameter or coverage-artifact-save is true
coverage-comment: false
For running tests in folders other than root, supply a working-directory.
uses: EkoCommunications/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
working-directory: "frontend"
For saving tests, supply a coverage-artifact-save
uses: EkoCommunications/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# code coverage will be reported, when this parameter or coverage-comment is true
coverage-artifact-save: true
For enabling multiple outputs/file types, supply multiple-outputs
uses: EkoCommunications/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
multiple-outputs: false
See the actions tab for runs of this action! 🌠