Skip to content
Ameen Abozaid
Planned lessonJNR-051-L03

Build and test pipeline

  • Lesson 3 of 7
  • Junior
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 verify so 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

yaml
- uses: actions/setup-java@v4
  with: { distribution: temurin, java-version: '21', cache: maven }
- run: ./mvnw -B verify

Check 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.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.