test.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. name: 'test'
  2. on: workflow_call
  3. permissions:
  4. contents: read # to fetch code (actions/checkout)
  5. jobs:
  6. unit-test:
  7. runs-on: ubuntu-latest
  8. env:
  9. PUPPETEER_SKIP_DOWNLOAD: 'true'
  10. steps:
  11. - uses: actions/checkout@v6
  12. - name: Setup Vite+
  13. uses: voidzero-dev/setup-vp@v1
  14. with:
  15. node-version-file: '.node-version'
  16. cache: true
  17. - name: Run unit tests
  18. run: vp run test-unit
  19. unit-test-windows:
  20. runs-on: windows-latest
  21. env:
  22. PUPPETEER_SKIP_DOWNLOAD: 'true'
  23. steps:
  24. - uses: actions/checkout@v6
  25. - name: Setup Vite+
  26. uses: voidzero-dev/setup-vp@v1
  27. with:
  28. node-version-file: '.node-version'
  29. cache: true
  30. - name: Run compiler unit tests
  31. run: vp run test-unit compiler
  32. - name: Run ssr unit tests
  33. run: vp run test-unit server-renderer
  34. e2e-test:
  35. runs-on: ubuntu-latest
  36. steps:
  37. - uses: actions/checkout@v6
  38. - name: Setup cache for Chromium binary
  39. uses: actions/cache@v5
  40. with:
  41. path: ~/.cache/puppeteer
  42. key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
  43. - name: Setup Vite+
  44. uses: voidzero-dev/setup-vp@v1
  45. with:
  46. node-version-file: '.node-version'
  47. cache: true
  48. - run: node node_modules/puppeteer/install.mjs
  49. - name: Run e2e tests
  50. run: vp run test-e2e
  51. - name: verify treeshaking
  52. run: node scripts/verify-treeshaking.js
  53. e2e-vapor:
  54. runs-on: ubuntu-latest
  55. steps:
  56. - uses: actions/checkout@v6
  57. - name: Setup cache for Chromium binary
  58. uses: actions/cache@v5
  59. with:
  60. path: ~/.cache/puppeteer
  61. key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
  62. - name: Setup Vite+
  63. uses: voidzero-dev/setup-vp@v1
  64. with:
  65. node-version-file: '.node-version'
  66. cache: true
  67. - run: node node_modules/puppeteer/install.mjs
  68. - name: Run e2e tests
  69. run: vp run test-e2e-vapor
  70. lint-and-test-dts:
  71. runs-on: ubuntu-latest
  72. env:
  73. PUPPETEER_SKIP_DOWNLOAD: 'true'
  74. steps:
  75. - uses: actions/checkout@v6
  76. - name: Setup Vite+
  77. uses: voidzero-dev/setup-vp@v1
  78. with:
  79. node-version-file: '.node-version'
  80. cache: true
  81. - name: Run lint
  82. run: vp run lint
  83. - name: Run format check
  84. run: vp run format-check
  85. - name: Run type check
  86. run: vp run check
  87. - name: Run type declaration tests
  88. run: vp run test-dts