diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml new file mode 100644 index 0000000..17d41f8 --- /dev/null +++ b/.github/workflows/maven-ci.yml @@ -0,0 +1,25 @@ +name: Java CI with Maven + +on: + push: + branches: [ "main", "develop" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + + - name: Build and test with Maven + run: mvn -B test --file pom.xml \ No newline at end of file diff --git a/README.md b/README.md index 871a860..a4d1b2d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Price Selector API +[![Java CI with Maven](https://github.com/robertluiz/price-selector-api/actions/workflows/maven-ci.yml/badge.svg)](https://github.com/robertluiz/price-selector-api/actions/workflows/maven-ci.yml) + ## Description This is a Spring Boot application that provides a REST API to query product prices for a given brand, product ID, and application date. It uses an in-memory H2 database initialized with sample data.