Answer the question
In order to leave comments, you need to log in
How to arrange CI for tests?
There is a project with react and jest tests.
I want to run tests and report coverage on every push (jest --coverage).
I wrote a yaml script as best I could, but it doesn't work, I don't understand why. How to make it work correctly?
name: CI
on: [push]
jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:
- name: Installation
- uses: actions/[email protected]
- uses: borales/[email protected]
with:
cmd: install # will run `yarn install` command
- uses: borales/[email protected]
with:
cmd: test # will run `yarn test` command
- uses: borales/[email protected]
with:
cmd: run jest --coverage # will run `yarn run jest` command
- name: Jest Coverage Commenter
# You may pin to the exact commit or the version.
# uses: dkershner6/[email protected]bf02941
- uses: dkershner6/[email protected]
with:
test_command: # optional, default is npx jest --coverage
"jest --coverage"
reporter:
"HoneyWood Reporter"
Answer the question
In order to leave comments, you need to log in
I didn't really go into your yaml file. On the topic of the question - you can use husky, pre-push setting in his config. Will look like this in package.json
{
// ...package.json
"husky": {
"hooks": {
"pre-push": "jest --coverage"
}
},
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question