InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.74k stars 936 forks source link

Add buildsize workflow #1518

Closed Riksu9000 closed 1 year ago

Riksu9000 commented 1 year ago

Add workflow jobs that create and update a comment on PRs with the build size and difference from the base branch (develop).

It will not work on this PR, because develop doesn't contain the getSize.sh script.

Here's an example of the jobs in action https://github.com/Riksu9000/InfiniTime/pull/15

FintasticMan commented 1 year ago

How will this work if a pull request isn't based off of the latest develop, but an older version? If there have been commits that increase space usage in develop, it might look like a PR adds less than it actually does, or even that it lowers space usage when it actually increases it.

Riksu9000 commented 1 year ago

Great point. I looked into it and it seems that the checkout action automatically merges the branches when checking out the head branch, so the only difference between base and head ref are the commits of the PR.

https://github.com/Riksu9000/InfiniTime/pull/16

develop is at 6439189373f2e70e25a130bccc7d4a6b8a7538d1 test-change is at d7d7856f0dba4dfa7e3e43b544c5391fd74e123e

I tested it by pushing a different commit to develop and test-change branches, then inspecting the build-firmware check log, which reads:

HEAD is now at e8cb4b2 Merge d7d7856f0dba4dfa7e3e43b544c5391fd74e123e into 6439189373f2e70e25a130bccc7d4a6b8a7538d1