Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'danger-plugin-istanbul-coverage' for github workflow #60

Open
anuroop15 opened this issue Jun 30, 2021 · 1 comment

Comments

@anuroop15
Copy link

anuroop15 commented Jun 30, 2021

name: Danger JS
on:
pull_request:
branches: [ develop ]
push:
branches: [ develop, main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use node version from .nvmrc
uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Danger
run: npx danger ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Looks like gitHub actions is looking for node modules when running dangerfile. Is there a way I can run istanbul coverage on github.

@anuroop15
Copy link
Author

`import { danger, warn, markdown, message, fail, schedule } from 'danger';
import { istanbulCoverage } from 'danger-plugin-istanbul-coverage';
schedule(() =>
istanbulCoverage({
// The location of the istanbul coverage file.
//coveragePath: "./coverage/*.json",
// Alternatively, if you have multiple coverage summaries, you can merge them into one report
coveragePaths: pathList,
// You can also specify the format, instead of letting it be inferred from the file name
// coveragePath: { path: "./coverage/
/lcov.info", type: "lcov" },

// Which set of files to summarise from the coverage file.
reportFileSet: 'all', // || "modified" || "created" || "createdOrModified"

// What to do when the PR doesn't meet the minimum code coverage threshold
reportMode: 'message', // || "warn" || "fail"

// Minimum coverage threshold percentages. Compared against the cumulative coverage of the reportFileSet.
threshold: {
  statements: 100,
  branches: 100,
  functions: 100,
  lines: 100,
},

})
);
`
My Danger file looks like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant