This is a fixed version of #28279:
Currently, if a pull request has more than one commit, previous commits may fail to compile, or may fail the tests. This is problematic, because it breaks git-bisect, or worse.
Fix this by adding a CI task for this.
The new job checks at most 6 commits of a pull request, excluding the top one.
The maximum number of tested commits is 6, which derives from the time constrains.
For historical context, please see:
A note for reviewers: To test scripts locally, ensure that you works with a shallow copy of the repo.