workflow runs on pull request creation/update events. It first checks if any code was changed, if not it skips to the end. If there were code changes, it will build the project(s) & run the tests. This can be used to block merging on the pull request to ensure all unit tests pass.
flowchart TD
trigger[Pull Request Trigger]
checkout[Checkout]
skip{"Can Skip?\n(e.g. no code changes)"}
build["Build Project(s)"]
runTests[Run Tests]
validate{Tests Passed?}
pass[Success!]
fail[Failure!]
class trigger internal-link;
trigger --> checkout --> skip
skip-->|Yes|pass
skip-->|No|build --> runTests --> validate
validate-->|Passed| pass
validate-->|Failed| fail