ci.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. env:
  16. PUPPETEER_SKIP_DOWNLOAD: 'true'
  17. steps:
  18. - uses: actions/checkout@v4
  19. - name: Install pnpm
  20. uses: pnpm/action-setup@v2
  21. - name: Install Node.js
  22. uses: actions/setup-node@v4
  23. with:
  24. node-version-file: '.node-version'
  25. cache: 'pnpm'
  26. - run: pnpm install
  27. - name: Run unit tests
  28. run: pnpm run test-unit
  29. lint-and-test-dts:
  30. runs-on: ubuntu-latest
  31. if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
  32. env:
  33. PUPPETEER_SKIP_DOWNLOAD: 'true'
  34. steps:
  35. - uses: actions/checkout@v4
  36. - name: Install pnpm
  37. uses: pnpm/action-setup@v2
  38. - name: Install Node.js
  39. uses: actions/setup-node@v4
  40. with:
  41. node-version-file: '.node-version'
  42. cache: 'pnpm'
  43. - run: pnpm install
  44. - name: Run eslint
  45. run: pnpm run lint
  46. - name: Run prettier
  47. run: pnpm run format-check
  48. - name: Run type declaration tests
  49. run: pnpm run test-dts
  50. release:
  51. concurrency:
  52. group: release
  53. if: |
  54. github.repository == 'vuejs/core-vapor' &&
  55. github.event_name == 'push' &&
  56. !contains(github.event.head_commit.message, 'skip release')
  57. runs-on: ubuntu-latest
  58. needs: [unit-test, lint-and-test-dts]
  59. steps:
  60. - uses: actions/checkout@v4
  61. - name: Install pnpm
  62. uses: pnpm/action-setup@v2
  63. - name: Install Node.js
  64. uses: actions/setup-node@v4
  65. with:
  66. node-version-file: '.node-version'
  67. registry-url: 'https://registry.npmjs.org'
  68. cache: 'pnpm'
  69. - run: pnpm install
  70. - run: pnpm release --vapor --skip-tests
  71. env:
  72. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  73. # benchmarks:
  74. # runs-on: ubuntu-latest
  75. # if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
  76. # env:
  77. # PUPPETEER_SKIP_DOWNLOAD: 'true'
  78. # steps:
  79. # - uses: actions/checkout@v4
  80. # - name: Install pnpm
  81. # uses: pnpm/action-setup@v2
  82. # - name: Install Node.js
  83. # uses: actions/setup-node@v4
  84. # with:
  85. # node-version-file: '.node-version'
  86. # cache: 'pnpm'
  87. # - run: pnpm install
  88. # - name: Run benchmarks
  89. # uses: CodSpeedHQ/action@v2
  90. # with:
  91. # run: pnpm vitest bench --run
  92. # token: ${{ secrets.CODSPEED_TOKEN }}