ci: determine which tests to run by diffing with previous builds
Created by: asdine
This PR determines which tests to run by running a diff with the previous successful build commit. If there is no previous passing build or if the diff fails for any reason, if runs a diff with main.
Fixes #25164 (closed)