test.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: tests
  2. on:
  3. push:
  4. branches:
  5. - master
  6. tags:
  7. - '*'
  8. pull_request:
  9. branches:
  10. - master
  11. env:
  12. FORCE_COLOR: 2
  13. jobs:
  14. lint:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v4
  18. - name: Use Node.js lts/*
  19. uses: actions/setup-node@v4
  20. with:
  21. node-version: lts/*
  22. - run: npm i
  23. - run: npm run check
  24. test:
  25. runs-on: ${{ matrix.os }}
  26. strategy:
  27. fail-fast: false
  28. matrix:
  29. os: [ubuntu-latest, windows-latest, macos-latest]
  30. node: ['lts/*', 18]
  31. steps:
  32. - uses: actions/checkout@v4
  33. - name: Use Node.js ${{ matrix.node }}
  34. uses: actions/setup-node@v4
  35. with:
  36. node-version: ${{ matrix.node }}
  37. - run: npm i
  38. - run: npm run test-mocha
  39. - uses: codecov/codecov-action@v5
  40. if: ${{ github.event_name == 'pull_request' }}
  41. with:
  42. flags: ${{ matrix.os }}-${{ matrix.node }}
  43. automerge:
  44. needs: [lint, test]
  45. runs-on: ubuntu-latest
  46. permissions:
  47. pull-requests: write
  48. contents: write
  49. steps:
  50. - uses: fastify/github-action-merge-dependabot@v3
  51. if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' && contains(github.head_ref, 'dependabot/github_actions') }}
  52. with:
  53. github-token: ${{ secrets.github_token }}