您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

web-tests.yml 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. name: Web Tests
  2. on:
  3. workflow_call:
  4. concurrency:
  5. group: web-tests-${{ github.head_ref || github.run_id }}
  6. cancel-in-progress: true
  7. jobs:
  8. test:
  9. name: Web Tests
  10. runs-on: ubuntu-latest
  11. defaults:
  12. run:
  13. working-directory: ./web
  14. steps:
  15. - name: Checkout code
  16. uses: actions/checkout@v4
  17. with:
  18. persist-credentials: false
  19. - name: Check changed files
  20. id: changed-files
  21. uses: tj-actions/changed-files@v46
  22. with:
  23. files: web/**
  24. - name: Install pnpm
  25. if: steps.changed-files.outputs.any_changed == 'true'
  26. uses: pnpm/action-setup@v4
  27. with:
  28. package_json_file: web/package.json
  29. run_install: false
  30. - name: Setup Node.js
  31. uses: actions/setup-node@v4
  32. if: steps.changed-files.outputs.any_changed == 'true'
  33. with:
  34. node-version: 22
  35. cache: pnpm
  36. cache-dependency-path: ./web/package.json
  37. - name: Install dependencies
  38. if: steps.changed-files.outputs.any_changed == 'true'
  39. working-directory: ./web
  40. run: pnpm install --frozen-lockfile
  41. - name: Run tests
  42. if: steps.changed-files.outputs.any_changed == 'true'
  43. working-directory: ./web
  44. run: pnpm test