test.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 Playwright browsers
  58. uses: actions/cache@v5
  59. with:
  60. path: ~/.cache/ms-playwright
  61. key: playwright-${{ runner.os }}-${{ 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. - name: Install Playwright Chromium
  68. run: vp exec playwright install chromium
  69. - name: Run e2e tests
  70. run: vp run test-e2e-vapor
  71. lint-and-test-dts:
  72. runs-on: ubuntu-latest
  73. env:
  74. PUPPETEER_SKIP_DOWNLOAD: 'true'
  75. steps:
  76. - uses: actions/checkout@v6
  77. - name: Setup Vite+
  78. uses: voidzero-dev/setup-vp@v1
  79. with:
  80. node-version-file: '.node-version'
  81. cache: true
  82. - name: Run lint
  83. run: vp run lint
  84. - name: Run format check
  85. run: vp run format-check
  86. - name: Run type check
  87. run: vp run check
  88. - name: Run type declaration tests
  89. run: vp run test-dts