ci.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. name: 'ci'
  2. on:
  3. push:
  4. branches:
  5. - '**'
  6. pull_request:
  7. branches:
  8. - main
  9. permissions:
  10. contents: read # to fetch code (actions/checkout)
  11. jobs:
  12. unit-test:
  13. runs-on: ubuntu-latest
  14. if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
  15. env:
  16. PUPPETEER_SKIP_DOWNLOAD: 'true'
  17. steps:
  18. - uses: actions/checkout@v4
  19. - name: Install pnpm
  20. uses: pnpm/action-setup@v2
  21. - name: Install Node.js
  22. uses: actions/setup-node@v4
  23. with:
  24. node-version-file: '.node-version'
  25. cache: 'pnpm'
  26. - run: pnpm install
  27. - name: Run unit tests
  28. run: pnpm run test-unit
  29. lint-and-test-dts:
  30. runs-on: ubuntu-latest
  31. if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
  32. env:
  33. PUPPETEER_SKIP_DOWNLOAD: 'true'
  34. steps:
  35. - uses: actions/checkout@v4
  36. - name: Install pnpm
  37. uses: pnpm/action-setup@v2
  38. - name: Install Node.js
  39. uses: actions/setup-node@v4
  40. with:
  41. node-version-file: '.node-version'
  42. cache: 'pnpm'
  43. - run: pnpm install
  44. - name: Run eslint
  45. run: pnpm run lint
  46. - name: Run prettier
  47. run: pnpm run format-check
  48. - name: Run type declaration tests
  49. run: pnpm run test-dts
  50. # benchmarks:
  51. # runs-on: ubuntu-latest
  52. # if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
  53. # env:
  54. # PUPPETEER_SKIP_DOWNLOAD: 'true'
  55. # steps:
  56. # - uses: actions/checkout@v4
  57. # - name: Install pnpm
  58. # uses: pnpm/action-setup@v2
  59. # - name: Install Node.js
  60. # uses: actions/setup-node@v4
  61. # with:
  62. # node-version-file: '.node-version'
  63. # cache: 'pnpm'
  64. # - run: pnpm install
  65. # - name: Run benchmarks
  66. # uses: CodSpeedHQ/action@v2
  67. # with:
  68. # run: pnpm vitest bench --run
  69. # token: ${{ secrets.CODSPEED_TOKEN }}