diff --git a/.github/workflows/spring_format_check.yml b/.github/workflows/spring_format_check.yml new file mode 100644 index 0000000..f0c3765 --- /dev/null +++ b/.github/workflows/spring_format_check.yml @@ -0,0 +1,29 @@ +name: Spring format check pipeline + +on: + push: + branches: + - main + paths: + - spring/** + pull_request: + paths: + - spring/** + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + + - name: Spring format check + working-directory: ./spring + run: mvn formatter:validate diff --git a/.github/workflows/spring_mvn_test.yml b/.github/workflows/spring_mvn_test.yml new file mode 100644 index 0000000..358e3fb --- /dev/null +++ b/.github/workflows/spring_mvn_test.yml @@ -0,0 +1,29 @@ +name: Spring mvn tests pipeline + +on: + push: + branches: + - main + paths: + - spring/** + pull_request: + paths: + - spring/** + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + + - name: Run mvn tests + working-directory: ./spring + run: mvn test diff --git a/spring/pom.xml b/spring/pom.xml index 6336003..d8e1557 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -54,6 +54,21 @@ + + net.revelc.code.formatter + formatter-maven-plugin + 2.24.1 + + UTF-8 + + + + + format + + + + org.springframework.boot spring-boot-maven-plugin diff --git a/spring/src/main/java/com/pogoda/weather/WeatherApplication.java b/spring/src/main/java/com/pogoda/weather/WeatherApplication.java index 96d4d3f..356571e 100644 --- a/spring/src/main/java/com/pogoda/weather/WeatherApplication.java +++ b/spring/src/main/java/com/pogoda/weather/WeatherApplication.java @@ -6,8 +6,8 @@ @SpringBootApplication public class WeatherApplication { - public static void main(String[] args) { - SpringApplication.run(WeatherApplication.class, args); - } + public static void main(String[] args) { + SpringApplication.run(WeatherApplication.class, args); + } } diff --git a/spring/src/test/java/com/pogoda/weather/WeatherApplicationTests.java b/spring/src/test/java/com/pogoda/weather/WeatherApplicationTests.java index 255b17f..bb6f25b 100644 --- a/spring/src/test/java/com/pogoda/weather/WeatherApplicationTests.java +++ b/spring/src/test/java/com/pogoda/weather/WeatherApplicationTests.java @@ -6,8 +6,8 @@ @SpringBootTest class WeatherApplicationTests { - @Test - void contextLoads() { - } + @Test + void contextLoads() { + } }