Jenkins Build on GitHub PullRequest

How do i execute a build on a PR in GitHub so that the PR can only succeed if the build succeeded?

I found this tutorial but it is quite outdated and uses the freestyle job.

I know how to trigger a jenkins build on a PR with a webhook but i want the result to display in GitHub

. Jenkins setup:Jenkins 2.426.1