diff --git a/.github/workflows/build_and_test_maven.yml b/.github/workflows/build_and_test_maven.yml new file mode 100644 index 0000000..d76d8c5 --- /dev/null +++ b/.github/workflows/build_and_test_maven.yml @@ -0,0 +1,44 @@ +name: Java CI with Gradle + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] +jobs: + build: + name: Build and Run Tests + runs-on: ubuntu-latest + + services: + postgres: + image: postgres:15.1-alpine + env: + POSTGRES_DB: wallet + POSTGRES_USER: postgres + POSTGRES_PASSWORD: 123 + ports: + - 5432:5432 + options: + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + env: + POSTGRES_HOST: postgres + - name: Build with Maven + run: mvn --batch-mode --update-snapshots verify + - name: Publish Test Report + uses: mikepenz/action-junit-report@v4 + if: success() || failure() # always run even if the previous step fails + with: + report_paths: '**/build/test-results/test/TEST-*.xml'