Build and test pipeline
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
build, test, and cache in a workflow.
Planned topics
- Set up Java with
actions/setup-java(distribution and version) and enable the Maven or Gradle cache. - Run
./mvnw verifyso unit and integration tests run; GitHub's Ubuntu runners include Docker, so Testcontainers works. - Fail the build if tests fail; also check that tests actually ran (report in the logs or upload test reports).
- Upload test reports as artifacts for debugging.
- Keep the pipeline fast; cache dependencies, not build output you cannot trust.
Draft outline details
Demonstration
- uses: actions/setup-java@v4
with: { distribution: temurin, java-version: '21', cache: maven }
- run: ./mvnw -B verifyCheck your understanding
Why upload test reports?
Show answer
To read failures without re-running locally.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.