ci.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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@v3.0.0
  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@v3.0.0
  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. permissions:
  60. contents: read
  61. id-token: write
  62. steps:
  63. - uses: actions/checkout@v4
  64. - name: Install pnpm
  65. uses: pnpm/action-setup@v2
  66. - name: Install Node.js
  67. uses: actions/setup-node@v4
  68. with:
  69. node-version-file: '.node-version'
  70. registry-url: 'https://registry.npmjs.org'
  71. cache: 'pnpm'
  72. - run: pnpm install
  73. - run: pnpm release --vapor --skip-tests
  74. env:
  75. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  76. NPM_CONFIG_PROVENANCE: 'true'
  77. # benchmarks:
  78. # runs-on: ubuntu-latest
  79. # if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
  80. # env:
  81. # PUPPETEER_SKIP_DOWNLOAD: 'true'
  82. # steps:
  83. # - uses: actions/checkout@v4
  84. # - name: Install pnpm
  85. # uses: pnpm/action-setup@v3.0.0
  86. # - name: Install Node.js
  87. # uses: actions/setup-node@v4
  88. # with:
  89. # node-version-file: '.node-version'
  90. # cache: 'pnpm'
  91. # - run: pnpm install
  92. # - name: Run benchmarks
  93. # uses: CodSpeedHQ/action@v2
  94. # with:
  95. # run: pnpm vitest bench --run
  96. # token: ${{ secrets.CODSPEED_TOKEN }}