ci.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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@v3
  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@v3
  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. e2e-test:
  49. runs-on: ubuntu-latest
  50. if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
  51. steps:
  52. - uses: actions/checkout@v4
  53. - name: Setup cache for Chromium binary
  54. uses: actions/cache@v3
  55. with:
  56. path: ~/.cache/puppeteer
  57. key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
  58. - name: Install pnpm
  59. uses: pnpm/action-setup@v2
  60. - name: Install Node.js
  61. uses: actions/setup-node@v3
  62. with:
  63. node-version-file: '.node-version'
  64. cache: 'pnpm'
  65. - run: pnpm install
  66. - run: node node_modules/puppeteer/install.mjs
  67. - name: Run e2e tests
  68. run: pnpm run test-e2e
  69. lint-and-test-dts:
  70. runs-on: ubuntu-latest
  71. if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
  72. env:
  73. PUPPETEER_SKIP_DOWNLOAD: 'true'
  74. steps:
  75. - uses: actions/checkout@v4
  76. - name: Install pnpm
  77. uses: pnpm/action-setup@v2
  78. - name: Install Node.js
  79. uses: actions/setup-node@v3
  80. with:
  81. node-version-file: '.node-version'
  82. cache: 'pnpm'
  83. - run: pnpm install
  84. - name: Run eslint
  85. run: pnpm run lint
  86. - name: Run prettier
  87. run: pnpm run format-check
  88. - name: Run type declaration tests
  89. run: pnpm run test-dts