ci.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: CI
  2. on:
  3. push:
  4. branches: ['main']
  5. pull_request:
  6. branches: ['main']
  7. merge_group:
  8. branches: ['main']
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v4
  14. with:
  15. fetch-depth: 0
  16. - name: Config Git User
  17. run: |
  18. git config --local user.name "dragooncjw"
  19. git config --local user.email "289056872@qq.com"
  20. - uses: actions/setup-node@v4
  21. with:
  22. node-version: 22
  23. - name: Setup pnpm
  24. uses: pnpm/action-setup@v4
  25. with:
  26. version: 10.6.5
  27. - name: Get pnpm store directory
  28. shell: bash
  29. run: |
  30. echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
  31. - name: Cache pnpm store
  32. uses: actions/cache@v4
  33. with:
  34. path: ${{ env.STORE_PATH }}
  35. key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
  36. restore-keys: |
  37. ${{ runner.os }}-pnpm-store-
  38. - name: Cache Rush build
  39. uses: actions/cache@v4
  40. with:
  41. path: |
  42. common/temp
  43. **/dist
  44. **/lib
  45. key: ${{ runner.os }}-rush-build-${{ hashFiles('**/pnpm-lock.yaml', '**/package.json', '**/tsconfig.json') }}
  46. restore-keys: |
  47. ${{ runner.os }}-rush-build-
  48. # - name: Verify Change Logs
  49. # run: node common/scripts/install-run-rush.js change --verify
  50. - name: Rush Install
  51. run: node common/scripts/install-run-rush.js install
  52. - name: Rush build
  53. run: node common/scripts/install-run-rush.js build
  54. - name: Check Lint & TS & Test
  55. run: |
  56. node common/scripts/install-run-rush.js lint --verbose &
  57. node common/scripts/install-run-rush.js ts-check &
  58. node common/scripts/install-run-rush.js test:cov &
  59. wait