ci.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. name: ci
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. branches:
  8. - '**'
  9. jobs:
  10. test:
  11. strategy:
  12. matrix:
  13. include:
  14. - name: Node.js 14
  15. NODE_VERSION: 14
  16. - name: Node.js 16
  17. NODE_VERSION: 16
  18. - name: Node.js 18
  19. NODE_VERSION: 18
  20. - name: Node.js 20
  21. NODE_VERSION: 20
  22. fail-fast: false
  23. name: ${{ matrix.name }}
  24. runs-on: ubuntu-latest
  25. timeout-minutes: 30
  26. steps:
  27. - uses: actions/checkout@v2
  28. - name: Use Node.js ${{ matrix.NODE_VERSION }}
  29. uses: actions/setup-node@v1
  30. with:
  31. node-version: ${{ matrix.NODE_VERSION }}
  32. - name: Cache Node.js modules
  33. uses: actions/cache@v2
  34. with:
  35. path: ~/.npm
  36. key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
  37. restore-keys: |
  38. ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
  39. - run: npm ci
  40. - run: npm run lint
  41. - run: npm run coverage
  42. - run: bash <(curl -s https://codecov.io/bash)