Skip to content

Continuous Integration with Node.js using GitHub Actions to test your NPM packages

License

Notifications You must be signed in to change notification settings

devenes/node-js-ci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Server with Express

Node.js CI Docker Build Node.js Scan SARIF Node.js Coverage Node.js Coverage

Continuous Integration with Node.js using GitHub Actions

Node.js CI

Define your branch name and the actions you want to trigger to start your job

  • Push

    push:
      branches: [main]
    
  • Pull Request

    pull_request:
      branches: [main]
    

Define your job name and the environment to build your code

jobs:
    build:
        runs-on: ubuntu-latest

Define the Node versions to test your code on

strategy:
    matrix:
        node-version: [12.x, 14.x, 16.x]

Define your CI steps under your job

steps:
    - uses: actions/checkout@v3
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
        cache: "npm"
    - run: npm ci
    - run: npm run build --if-present
    - run: npm test