diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02660d7..0a2a03c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,14 +15,14 @@ jobs: build: name: Build and verify runs-on: ubuntu-latest - timeout-minutes: 45 + timeout-minutes: 60 steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Set up Java 21 - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: temurin java-version: '21' @@ -31,5 +31,14 @@ jobs: - name: Make Maven Wrapper executable run: chmod +x mvnw + - name: Pre-pull Oracle test image + run: | + for attempt in 1 2 3; do + docker pull gvenzl/oracle-free:slim-faststart && exit 0 + echo "Oracle image pull failed on attempt ${attempt}; retrying..." + sleep 20 + done + exit 1 + - name: Verify with Maven run: ./mvnw --batch-mode clean verify diff --git a/README.md b/README.md index f0f00dc..c22d96c 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ The `test` profile uses an in-memory H2 database in Oracle compatibility mode so .\mvnw.cmd clean verify ``` -`clean verify` includes a Testcontainers-backed Oracle integration test. Docker must be running locally. +`clean test` runs the fast unit and WebMvc slice tests. `clean verify` also runs the Failsafe integration-test phase, including a Testcontainers-backed Oracle Free integration test. Docker must be running locally. ## Docker Compose @@ -96,7 +96,7 @@ GitHub Actions runs on every push and pull request to `main`: .github/workflows/ci.yml ``` -The workflow uses Java 21, Maven dependency caching, Docker-enabled Ubuntu runners, and `./mvnw --batch-mode clean verify`. +The workflow uses Java 21, Maven dependency caching, Docker-enabled Ubuntu runners, a pre-pulled Oracle Free test image, and `./mvnw --batch-mode clean verify`. ## Local Run diff --git a/pom.xml b/pom.xml index 91bd4d3..16d3646 100644 --- a/pom.xml +++ b/pom.xml @@ -111,6 +111,32 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*IntegrationTest.java + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + **/*IntegrationTest.java + + + + + + integration-test + verify + + + + diff --git a/src/test/java/com/portfolio/merchantapi/transaction/TransactionIntegrationTest.java b/src/test/java/com/portfolio/merchantapi/transaction/TransactionIntegrationTest.java index 45c7c95..195ce71 100644 --- a/src/test/java/com/portfolio/merchantapi/transaction/TransactionIntegrationTest.java +++ b/src/test/java/com/portfolio/merchantapi/transaction/TransactionIntegrationTest.java @@ -28,7 +28,7 @@ class TransactionIntegrationTest { private static final DockerImageName ORACLE_IMAGE = DockerImageName - .parse("gvenzl/oracle-free:23-slim") + .parse("gvenzl/oracle-free:slim-faststart") .asCompatibleSubstituteFor("gvenzl/oracle-xe"); @Container