Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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-xe:21-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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Merchant API is a Spring Boot REST service for managing merchants and their paym
- Oracle JDBC for local and production-style runtime
- Flyway for SQL database migrations
- H2 for test execution
- Testcontainers with Oracle Free for integration testing
- Testcontainers with Oracle XE for integration testing
- Springdoc OpenAPI / Swagger UI
- Docker Compose with Oracle Free
- Maven Wrapper
Expand Down Expand Up @@ -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 XE integration test. Docker must be running locally.

## Docker Compose

Expand All @@ -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 XE test image, and `./mvnw --batch-mode clean verify`.

## Local Run

Expand Down
26 changes: 26 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,32 @@
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class TransactionIntegrationTest {

private static final DockerImageName ORACLE_IMAGE = DockerImageName
.parse("gvenzl/oracle-free:23-slim")
.parse("gvenzl/oracle-xe:21-slim-faststart")
.asCompatibleSubstituteFor("gvenzl/oracle-xe");

@Container
Expand Down