action.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 --save-json bloat.json
  38. ./ydb/ci/build_bloat/template_bloat.py -j bloat.json -o template_bloat -t template_bloat_html
  39. ./ydb/ci/build_bloat/main.py --build-dir . --html-dir-cpp html_cpp_impact --html-dir-headers html_headers_impact
  40. ./ydb/ci/build_bloat/ydb_upload.py --html-dir-cpp html_cpp_impact --html-dir-headers html_headers_impact
  41. - name: Upload results
  42. shell: bash
  43. run: |
  44. set -ex
  45. 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/"
  46. 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
  47. s3cmd sync -r --acl-public --stats --no-progress --no-mime-magic --guess-mime-type --no-check-md5 "template_bloat.by_size.txt" "$S3_BUCKET_PATH/template_bloat.by_size.txt"
  48. TEMPLATE_BLOAT_BY_SIZE_URL=$S3_URL_PREFIX/template_bloat.by_size.txt
  49. s3cmd sync -r --acl-public --stats --no-progress --no-mime-magic --guess-mime-type --no-check-md5 "template_bloat.by_count.txt" "$S3_BUCKET_PATH/template_bloat.by_count.txt"
  50. TEMPLATE_BLOAT_BY_COUNT_URL=$S3_URL_PREFIX/template_bloat.by_count.txt
  51. s3cmd sync -r --acl-public --stats --no-progress --no-mime-magic --guess-mime-type --no-check-md5 "template_bloat_html/" "$S3_BUCKET_PATH/template_bloat_html/"
  52. TEMPLATE_BLOAT_TREEMAP_URL=$S3_URL_PREFIX/template_bloat_html/index.html
  53. echo "[template bloat]($TEMPLATE_BLOAT_TREEMAP_URL) ([sorted by size]($TEMPLATE_BLOAT_BY_SIZE_URL), [sorted by count]($TEMPLATE_BLOAT_BY_COUNT_URL))" >> $GITHUB_STEP_SUMMARY
  54. 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/"
  55. echo "[cpp compilation time]($S3_URL_PREFIX/html_cpp_impact/index.html)" >> $GITHUB_STEP_SUMMARY
  56. 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/"
  57. echo "[headers impact]($S3_URL_PREFIX/html_headers_impact/index.html)" >> $GITHUB_STEP_SUMMARY