Running JDK pre-submit testing on GitHub
robin.westberg at oracle.com
Wed Sep 16 13:05:40 UTC 2020
When making changes to the JDK, you almost always want to run a number of tests before submitting the change for review through a pull request. The test selection naturally depends on the nature of the change, but at the very least you often want to make sure that the “tier1” tests complete successfully on different platforms. This, however, can be easier said than done, depending on whether you have access to some correctly configured idle machines where you can execute them.
To improve the situation, we have looked into making it simple to run this type of testing with GitHub Actions  using the free tier  available to everyone working with open source repositories. (GitHub Actions, for those of you unfamiliar with it, allows you to run up to 20 parallell jobs on virtual machines  provided by GitHub).
After a bit of experimenting, I believe that we have arrived at something that is ready for any interested OpenJDK contributor to try out. It currently runs the “tier1” group of tests on Linux, Windows and macOS on a “fastdebug” build. Here’s an example of what it looks like: https://github.com/rwestberg/jdk/actions/runs/257434343
If you would like to try this out yourself, simply add the file https://github.com/rwestberg/jdk/blob/submit_gh_actions/.github/workflows/submit.yml with the same name and path to any branch in a local repository and push it to your personal fork. Within a few seconds, a new job should appear in the Actions tab in the GitHub web UI for your personal fork where you can view the progress.
If this turns out to be something that contributors find useful, we can commit such a file to the JDK main-line repository. This will then be readily available for any branch you push to your your personal fork.
More information about the jdk-dev