action.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: build_analytics
  2. description: Gather and send build analytics
  3. inputs:
  4. build_preset:
  5. type: string
  6. default: ""
  7. build_target:
  8. type: string
  9. default: ""
  10. secs:
  11. type: string
  12. default: ""
  13. vars:
  14. type: string
  15. default: ""
  16. runs:
  17. using: "composite"
  18. steps:
  19. - name: Prepare s3cmd
  20. uses: ./.github/actions/s3cmd
  21. with:
  22. s3_bucket: ${{ fromJSON( inputs.vars ).AWS_BUCKET }}
  23. s3_endpoint: ${{ fromJSON( inputs.vars ).AWS_ENDPOINT }}
  24. s3_key_id: ${{ fromJSON( inputs.secs ).AWS_KEY_ID }}
  25. s3_key_secret: ${{ fromJSON( inputs.secs ).AWS_KEY_VALUE }}
  26. folder_prefix: ya-
  27. build_preset: ${{ inputs.build_preset }}
  28. - name: Run analytics tools
  29. shell: bash
  30. run: |
  31. set -ex
  32. # FIXME: target name may be not the same as dir name
  33. export TARGET_NAME=`basename ${{ inputs.build_target }}`
  34. export TARGET_DIR=${{ inputs.build_target }}
  35. export build_preset="${{ inputs.build_preset }}"
  36. export build_target="${{ inputs.build_target }}"
  37. ./ya tool bloat --linker-map $TARGET_DIR/$TARGET_NAME.map.lld --input $TARGET_DIR/$TARGET_NAME --save-html ya_bloat_html
  38. ./ydb/ci/build_bloat/main.py --build-dir . --html-dir-cpp html_cpp_impact --html-dir-headers html_headers_impact
  39. ./ydb/ci/build_bloat/ydb_upload.py --html-dir-cpp html_cpp_impact --html-dir-headers html_headers_impact
  40. - name: Upload results
  41. shell: bash
  42. run: |
  43. set -ex
  44. s3cmd sync -r --acl-public --stats --no-progress --no-mime-magic --guess-mime-type --no-check-md5 "ya_bloat_html/" "$S3_BUCKET_PATH/ya_bloat_html/"
  45. echo "[ya bloat tool]($S3_URL_PREFIX/ya_bloat_html/index.html) (better use Safari, because it is too large for Chrome)" >> $GITHUB_STEP_SUMMARY
  46. s3cmd sync -r --acl-public --stats --no-progress --no-mime-magic --guess-mime-type --no-check-md5 "html_cpp_impact/" "$S3_BUCKET_PATH/html_cpp_impact/"
  47. echo "[cpp compilation time]($S3_URL_PREFIX/html_cpp_impact/index.html)" >> $GITHUB_STEP_SUMMARY
  48. s3cmd sync -r --acl-public --stats --no-progress --no-mime-magic --guess-mime-type --no-check-md5 "html_headers_impact/" "$S3_BUCKET_PATH/html_headers_impact/"
  49. echo "[headers impact]($S3_URL_PREFIX/html_headers_impact/index.html)" >> $GITHUB_STEP_SUMMARY