Home > Mobile >  How to write a pipeline for a pull request for lint and run tests
How to write a pipeline for a pull request for lint and run tests

Time:11-08

I never wrote pipelines in github actions, I was asked to create a pipeline for a pull request for repositories in github using the commands:

npm run lint;
npm run test;

CodePudding user response:

GitHub's own setup-node Action has examples of how to do this. Based on the docs there, something like this placed in a YAML file in the .github/workflows directory should work:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
  with:
    node-version: '16'
- run: npm install
- run: npm lint
- run: npm test
  • Related