ci.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. unit-test-windows:
  30. runs-on: windows-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 compiler unit tests
  45. run: pnpm run test-unit compiler
  46. - name: Run ssr unit tests
  47. run: pnpm run test-unit server-renderer
  48. benchmarks:
  49. runs-on: ubuntu-latest
  50. if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
  51. env:
  52. PUPPETEER_SKIP_DOWNLOAD: 'true'
  53. steps:
  54. - uses: actions/checkout@v4
  55. - name: Install pnpm
  56. uses: pnpm/action-setup@v2
  57. - name: Install Node.js
  58. uses: actions/setup-node@v4
  59. with:
  60. node-version-file: '.node-version'
  61. cache: 'pnpm'
  62. - run: pnpm install
  63. - name: Run benchmarks
  64. uses: CodSpeedHQ/action@v2
  65. with:
  66. run: pnpm vitest bench --run
  67. token: ${{ secrets.CODSPEED_TOKEN }}
  68. e2e-test:
  69. runs-on: ubuntu-latest
  70. if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
  71. steps:
  72. - uses: actions/checkout@v4
  73. - name: Setup cache for Chromium binary
  74. uses: actions/cache@v3
  75. with:
  76. path: ~/.cache/puppeteer
  77. key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
  78. - name: Install pnpm
  79. uses: pnpm/action-setup@v2
  80. - name: Install Node.js
  81. uses: actions/setup-node@v4
  82. with:
  83. node-version-file: '.node-version'
  84. cache: 'pnpm'
  85. - run: pnpm install
  86. - run: node node_modules/puppeteer/install.mjs
  87. - name: Run e2e tests
  88. run: pnpm run test-e2e
  89. lint-and-test-dts:
  90. runs-on: ubuntu-latest
  91. if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
  92. env:
  93. PUPPETEER_SKIP_DOWNLOAD: 'true'
  94. steps:
  95. - uses: actions/checkout@v4
  96. - name: Install pnpm
  97. uses: pnpm/action-setup@v2
  98. - name: Install Node.js
  99. uses: actions/setup-node@v4
  100. with:
  101. node-version-file: '.node-version'
  102. cache: 'pnpm'
  103. - run: pnpm install
  104. - name: Run eslint
  105. run: pnpm run lint
  106. - name: Run prettier
  107. run: pnpm run format-check
  108. - name: Run type declaration tests
  109. run: pnpm run test-dts