benchmark.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: OpenTelemetry-cpp benchmarks
  2. on:
  3. push:
  4. branches:
  5. - main
  6. permissions:
  7. contents: write
  8. deployments: write
  9. jobs:
  10. benchmark:
  11. name: Run OpenTelemetry-cpp benchmarks
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Harden the runner (Audit all outbound calls)
  15. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  16. with:
  17. egress-policy: audit
  18. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  19. with:
  20. submodules: 'recursive'
  21. - name: Mount Bazel Cache
  22. uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
  23. env:
  24. cache-name: bazel_cache
  25. with:
  26. path: /home/runner/.cache/bazel
  27. key: bazel_benchmark
  28. - name: setup
  29. run: |
  30. sudo ./ci/setup_ci_environment.sh
  31. sudo ./ci/install_bazelisk.sh
  32. - name: Run benchmark
  33. id: run_benchmarks
  34. run: |
  35. ./ci/do_ci.sh bazel.benchmark
  36. mkdir -p benchmarks
  37. mv api-benchmark_result.json benchmarks
  38. mv sdk-benchmark_result.json benchmarks
  39. mv exporters-benchmark_result.json benchmarks
  40. - uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # main March 2025
  41. with:
  42. name: benchmark_results
  43. path: benchmarks
  44. store_benchmark:
  45. needs: benchmark
  46. strategy:
  47. matrix:
  48. components: ["api", "sdk", "exporters"]
  49. name: Store benchmark result
  50. runs-on: ubuntu-latest
  51. steps:
  52. - name: Harden the runner (Audit all outbound calls)
  53. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  54. with:
  55. egress-policy: audit
  56. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  57. - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # main March 2025
  58. with:
  59. name: benchmark_results
  60. path: benchmarks
  61. - name: Print json files
  62. id: print_json
  63. run: |
  64. cat benchmarks/*
  65. - name: Push benchmark result
  66. uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1.20.4
  67. with:
  68. name: OpenTelemetry-cpp ${{ matrix.components }} Benchmark
  69. tool: 'googlecpp'
  70. output-file-path: benchmarks/${{ matrix.components }}-benchmark_result.json
  71. github-token: ${{ secrets.GITHUB_TOKEN }}
  72. auto-push: true
  73. # Show alert with commit comment on detecting possible performance regression
  74. alert-threshold: '200%'
  75. comment-on-alert: true
  76. fail-on-alert: false
  77. gh-pages-branch: gh-pages
  78. benchmark-data-dir-path: benchmarks