A minimal Java project demonstrating Maven, JUnit 5, GitHub Actions, CI artifacts, and GitHub Releases.
JDK 21 and Maven 3.9+.
mvn clean verify
java -jar target/edu-java-ci-cd-1.0.0.jarThe program computes the hypotenuse of a right triangle. Its JUnit test checks the result.
On pushes and pull requests targeting main, the CI workflow checks out the code, sets up Java 21, runs mvn clean verify, and uploads the JAR under Actions → workflow run → Artifacts.
When a GitHub Release is published, the release workflow builds and tests the project, then attaches the JAR to that release. To demonstrate, create tag v1.0.0 and publish a release for it.
CI artifacts are attached to workflow runs; release assets are attached to published releases.
- Break the calculation intentionally and inspect the failing CI test.
- Add tests for zero and decimal inputs.
- Add another method and test it.
- Compare workflow artifacts with release assets.
- Explore macOS
jpackageusing the historical, inactive.github/workflows/old.txtas a starting point.
This is a teaching example, not a production application. The historical workflow notes remain unmodified for reference.