performance.yml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. name: Performance
  2. on:
  3. pull_request:
  4. workflow_dispatch:
  5. inputs:
  6. base:
  7. description: Baseline commit or branch
  8. required: true
  9. default: main
  10. type: string
  11. suite:
  12. description: Performance suite (full includes startup and long history)
  13. required: true
  14. default: full
  15. type: choice
  16. options: [full, basic]
  17. permissions:
  18. contents: read
  19. concurrency:
  20. group: performance-${{ github.event_name }}-${{ inputs.suite || 'basic' }}-${{ github.ref }}
  21. cancel-in-progress: true
  22. jobs:
  23. performance:
  24. name: performance (${{ inputs.suite || 'basic' }})
  25. runs-on: macos-15
  26. timeout-minutes: ${{ inputs.suite == 'full' && 45 || 15 }}
  27. steps:
  28. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  29. with:
  30. path: candidate
  31. ref: ${{ github.event.pull_request.head.sha || github.sha }}
  32. persist-credentials: false
  33. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  34. with:
  35. path: baseline
  36. ref: ${{ github.event.pull_request.base.sha || inputs.base }}
  37. persist-credentials: false
  38. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  39. with:
  40. repository: KonghaYao/harness-perf-benchmark
  41. ref: 8ad1e09f7653d7e97b83b4f5b4d347ca2fa129c7
  42. path: benchmark
  43. persist-credentials: false
  44. - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
  45. with:
  46. version: 9.12.0
  47. package_json_file: candidate/package.json
  48. - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
  49. with:
  50. node-version: 22.23.2
  51. package-manager-cache: false
  52. - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
  53. with:
  54. bun-version: 1.4.2
  55. - name: Build baseline
  56. working-directory: baseline
  57. run: |
  58. pnpm install --frozen-lockfile
  59. pnpm build
  60. - name: Build candidate
  61. working-directory: candidate
  62. run: |
  63. pnpm install --frozen-lockfile
  64. pnpm build
  65. - name: Install pinned benchmark
  66. working-directory: benchmark
  67. run: bun install --frozen-lockfile
  68. - name: Compare on this runner
  69. env:
  70. PERF_SUITE: ${{ inputs.suite || 'basic' }}
  71. run: node candidate/scripts/perf/run.mjs --base baseline --head candidate --benchmark benchmark --suite "$PERF_SUITE" --out "$RUNNER_TEMP/performance"
  72. - name: Upload performance evidence
  73. if: ${{ always() }}
  74. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
  75. with:
  76. name: performance-${{ inputs.suite || 'basic' }}-${{ github.run_attempt }}
  77. path: ${{ runner.temp }}/performance/
  78. include-hidden-files: true
  79. retention-days: 14
  80. if-no-files-found: warn