Skip to content
Open
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
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '16'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn verify -Dit=true
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# spring-boot-tests
## Run Tests
```
mvn verify -Ddocker_host=localhost
mvn verify -Dit=true

# Docker Daemon host can be customized with: -Ddocker_host=unix:///var/run/docker.sock
```

## Start/Stop containers for IDE tests running
```
mvn docker:start -Ddocker_host=localhost
mvn docker:stop -Ddocker_host=localhost
mvn docker:start -Dit=true
mvn docker:stop -Dit=true

# Docker Daemon host can be customized with: -Ddocker_host=unix:///var/run/docker.sock
```
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@
<id>it</id>
<activation>
<property>
<name>docker_host</name>
<name>it</name>
<value>true</value>
</property>
</activation>
<properties>
<docker_port>2375</docker_port>
<postgres_host>0.0.0.0</postgres_host>
<postgres_port>5432</postgres_port>

</properties>
<build>
<plugins>
Expand All @@ -114,7 +115,7 @@
<configuration>
<environmentVariables>
<spring.profiles.active>tests-remote</spring.profiles.active>
<postgres_host>${docker_host}</postgres_host>
<postgres_host>${postgres_host}</postgres_host>
<postgres_port>${postgres_port}</postgres_port>
</environmentVariables>
</configuration>
Expand All @@ -141,7 +142,7 @@
</execution>
</executions>
<configuration>
<dockerHost>tcp://${docker_host}:${docker_port}</dockerHost>
<dockerHost>${docker_host}</dockerHost>
<images>
<image>
<name>postgres:11</name>
Expand Down