node.js.yml 889 B

12345678910111213141516171819202122232425262728293031323334
  1. # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
  2. # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
  3. name: Node.js CI
  4. on:
  5. push:
  6. branches: [ master ]
  7. pull_request:
  8. branches: [ master ]
  9. jobs:
  10. build:
  11. runs-on: ${{ matrix.os }}
  12. strategy:
  13. matrix:
  14. os:
  15. - ubuntu-latest
  16. - macos-latest
  17. - windows-latest
  18. node_version:
  19. - 12.x
  20. - 14.x
  21. - 16.x
  22. steps:
  23. - uses: actions/checkout@v2
  24. - name: Use Node.js ${{ matrix.node-version }}
  25. uses: actions/setup-node@v1
  26. with:
  27. node-version: ${{ matrix.node-version }}
  28. - run: npm ci
  29. - run: npm run build --if-present
  30. - run: npm test