ci.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. steps:
  15. - uses: actions/checkout@v3
  16. - name: Install pnpm
  17. uses: pnpm/action-setup@v2
  18. - name: Set node version to 18
  19. uses: actions/setup-node@v3
  20. with:
  21. node-version: 18
  22. cache: 'pnpm'
  23. - run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
  24. - name: Run unit tests
  25. run: pnpm run test-unit
  26. e2e-test:
  27. runs-on: ubuntu-latest
  28. steps:
  29. - uses: actions/checkout@v3
  30. - name: Setup cache for Chromium binary
  31. uses: actions/cache@v3
  32. with:
  33. path: ~/.cache/puppeteer/chrome
  34. key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
  35. - name: Install pnpm
  36. uses: pnpm/action-setup@v2
  37. - name: Set node version to 18
  38. uses: actions/setup-node@v3
  39. with:
  40. node-version: 18
  41. cache: 'pnpm'
  42. - run: pnpm install
  43. - name: Run e2e tests
  44. run: pnpm run test-e2e
  45. lint-and-test-dts:
  46. runs-on: ubuntu-latest
  47. steps:
  48. - uses: actions/checkout@v3
  49. - name: Install pnpm
  50. uses: pnpm/action-setup@v2
  51. - name: Set node version to 18
  52. uses: actions/setup-node@v3
  53. with:
  54. node-version: 18
  55. cache: 'pnpm'
  56. - run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
  57. - name: Run eslint
  58. run: pnpm run lint
  59. # - name: Run prettier
  60. # run: pnpm run format-check
  61. - name: Run type declaration tests
  62. run: pnpm run test-dts
  63. size:
  64. runs-on: ubuntu-latest
  65. env:
  66. CI_JOB_NUMBER: 1
  67. steps:
  68. - uses: actions/checkout@v3
  69. - name: Install pnpm
  70. uses: pnpm/action-setup@v2
  71. - name: Set node version to 18
  72. uses: actions/setup-node@v3
  73. with:
  74. node-version: 18
  75. cache: 'pnpm'
  76. - run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
  77. - run: pnpm run size
  78. # - name: Check build size
  79. # uses: posva/size-check-action@v1.1.2
  80. # with:
  81. # github_token: ${{ secrets.GITHUB_TOKEN }}
  82. # build_script: size
  83. # files: packages/vue/dist/vue.global.prod.js packages/runtime-dom/dist/runtime-dom.global.prod.js packages/size-check/dist/index.js