Newer
Older
dub_jkp / scripts / ci / summary_comment.sh
@WebFreak001 WebFreak001 on 9 Mar 2023 745 bytes add pr_info GitHub actions run
  1. #!/usr/bin/env bash
  2.  
  3. set -u
  4.  
  5. # Output from this script is piped to a file by CI, being run from before a
  6. # change has been made and after a change has been made. Then both outputs are
  7. # compared using summary_comment_diff.sh
  8.  
  9. # cd to git folder, just in case this is manually run:
  10. ROOT_DIR="$( cd "$(dirname "${BASH_SOURCE[0]}")/../../" && pwd )"
  11. cd ${ROOT_DIR}
  12.  
  13. dub --version
  14. ldc2 --version
  15.  
  16. # fetch missing packages before timing
  17. dub upgrade --missing-only
  18.  
  19. start=`date +%s`
  20. dub build --build=release --force 2>&1 || echo "BUILD FAILED"
  21. end=`date +%s`
  22. build_time=$( echo "$end - $start" | bc -l )
  23.  
  24. strip bin/dub
  25.  
  26. echo "STAT:statistics (-before, +after)"
  27. echo "STAT:executable size=$(wc -c bin/dub)"
  28. echo "STAT:rough build time=${build_time}s"