main.yml 647 B

1234567891011121314151617181920212223242526272829
  1. name: CI
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. branches: [ master ]
  7. jobs:
  8. test:
  9. name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
  10. runs-on: ${{ matrix.os }}
  11. strategy:
  12. matrix:
  13. node_version: ['12.x', '14.x', '16.x', '18.x', '19.x', '20.x']
  14. os: [ubuntu-latest]
  15. steps:
  16. - uses: actions/checkout@v2
  17. - name: Use Node.js ${{ matrix.node_version }}
  18. uses: actions/setup-node@v1
  19. with:
  20. node-version: ${{ matrix.node_version }}
  21. - name: npm install, build and test
  22. run: |
  23. npm install
  24. npm run build --if-present
  25. npm test