test.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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: Install pnpm
  13. uses: pnpm/action-setup@v4.2.0
  14. - name: Install Node.js
  15. uses: actions/setup-node@v6
  16. with:
  17. node-version-file: '.node-version'
  18. cache: 'pnpm'
  19. - run: pnpm install
  20. - name: Run unit tests
  21. run: pnpm run test-unit
  22. unit-test-windows:
  23. runs-on: windows-latest
  24. env:
  25. PUPPETEER_SKIP_DOWNLOAD: 'true'
  26. steps:
  27. - uses: actions/checkout@v6
  28. - name: Install pnpm
  29. uses: pnpm/action-setup@v4.2.0
  30. - name: Install Node.js
  31. uses: actions/setup-node@v6
  32. with:
  33. node-version-file: '.node-version'
  34. cache: 'pnpm'
  35. - run: pnpm install
  36. - name: Run compiler unit tests
  37. run: pnpm run test-unit compiler
  38. - name: Run ssr unit tests
  39. run: pnpm run test-unit server-renderer
  40. e2e-test:
  41. runs-on: ubuntu-latest
  42. steps:
  43. - uses: actions/checkout@v6
  44. - name: Setup cache for Chromium binary
  45. uses: actions/cache@v4
  46. with:
  47. path: ~/.cache/puppeteer
  48. key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
  49. - name: Install pnpm
  50. uses: pnpm/action-setup@v4.2.0
  51. - name: Install Node.js
  52. uses: actions/setup-node@v6
  53. with:
  54. node-version-file: '.node-version'
  55. cache: 'pnpm'
  56. - run: pnpm install
  57. - run: node node_modules/puppeteer/install.mjs
  58. - name: Run e2e tests
  59. run: pnpm run test-e2e
  60. - name: verify treeshaking
  61. run: node scripts/verify-treeshaking.js
  62. e2e-vapor:
  63. runs-on: ubuntu-latest
  64. steps:
  65. - uses: actions/checkout@v4
  66. - name: Setup cache for Chromium binary
  67. uses: actions/cache@v4
  68. with:
  69. path: ~/.cache/puppeteer
  70. key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
  71. - name: Install pnpm
  72. uses: pnpm/action-setup@v4.0.0
  73. - name: Install Node.js
  74. uses: actions/setup-node@v4
  75. with:
  76. node-version-file: '.node-version'
  77. cache: 'pnpm'
  78. - run: pnpm install
  79. - run: node node_modules/puppeteer/install.mjs
  80. - name: Run e2e tests
  81. run: pnpm run test-e2e-vapor
  82. lint-and-test-dts:
  83. runs-on: ubuntu-latest
  84. env:
  85. PUPPETEER_SKIP_DOWNLOAD: 'true'
  86. steps:
  87. - uses: actions/checkout@v6
  88. - name: Install pnpm
  89. uses: pnpm/action-setup@v4.2.0
  90. - name: Install Node.js
  91. uses: actions/setup-node@v6
  92. with:
  93. node-version-file: '.node-version'
  94. cache: 'pnpm'
  95. - run: pnpm install
  96. - name: Run oxlint
  97. run: pnpm run lint
  98. - name: Run oxfmt
  99. run: pnpm run format-check
  100. - name: Run tsc
  101. run: pnpm run check
  102. - name: Run type declaration tests
  103. run: pnpm run test-dts