ci.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. steps:
  16. - uses: actions/checkout@v3
  17. - name: Install pnpm
  18. uses: pnpm/action-setup@v2
  19. - name: Set node version to 18
  20. uses: actions/setup-node@v3
  21. with:
  22. node-version: 18
  23. cache: 'pnpm'
  24. - name: Skip Puppeteer download
  25. run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $GITHUB_ENV
  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. steps:
  33. - uses: actions/checkout@v3
  34. - name: Install pnpm
  35. uses: pnpm/action-setup@v2
  36. - name: Set node version to 18
  37. uses: actions/setup-node@v3
  38. with:
  39. node-version: 18
  40. cache: 'pnpm'
  41. - name: Skip Puppeteer download
  42. run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $env:GITHUB_ENV
  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@v3
  53. - name: Setup cache for Chromium binary
  54. uses: actions/cache@v3
  55. with:
  56. path: ~/.cache/puppeteer/chrome
  57. key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
  58. - name: Install pnpm
  59. uses: pnpm/action-setup@v2
  60. - name: Set node version to 18
  61. uses: actions/setup-node@v3
  62. with:
  63. node-version: 18
  64. cache: 'pnpm'
  65. - run: pnpm install
  66. - name: Run e2e tests
  67. run: pnpm run test-e2e
  68. lint-and-test-dts:
  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@v3
  73. - name: Install pnpm
  74. uses: pnpm/action-setup@v2
  75. - name: Set node version to 18
  76. uses: actions/setup-node@v3
  77. with:
  78. node-version: 18
  79. cache: 'pnpm'
  80. - name: Skip Puppeteer download
  81. run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $GITHUB_ENV
  82. - run: pnpm install
  83. - name: Run eslint
  84. run: pnpm run lint
  85. - name: Run prettier
  86. run: pnpm run format-check
  87. - name: Run type declaration tests
  88. run: pnpm run test-dts