diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9af89a2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,74 @@ +# 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://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Java CI with Maven + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + # The workflow runner will start these containers before the job's steps, and then stop them afterwards. + services: + # Label used to access the service container + postgres: + # Docker Hub image + image: postgres + # Provide the password for postgres + env: + POSTGRES_PASSWORD: postgres + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Opens the port on the host and service container + - 5432:5432 + + steps: + - name: Checkout Project + uses: actions/checkout@v3 + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'temurin' + cache: maven + - name: Configure Maven Settings for ITs + uses: whelk-io/maven-settings-xml-action@v20 + with: + profiles: | + [ + { + "id": "rps", + "properties": { + "com.justdavis.karl.datasources.provisioner.postgresql.server.url": "jdbc:postgresql:postgres", + "com.justdavis.karl.datasources.provisioner.postgresql.server.user": "postgres", + "com.justdavis.karl.datasources.provisioner.postgresql.server.password": "postgres" + } + } + ] + active_profiles: | + [ + "rps" + ] + + - name: Build with Maven + run: mvn -B verify --file pom.xml + + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + - name: Update dependency graph + uses: advanced-security/maven-dependency-submission-action@v3 diff --git a/pom.xml b/pom.xml index 6366960..89e12e6 100644 --- a/pom.xml +++ b/pom.xml @@ -234,6 +234,15 @@ + + org.apache.maven.plugins + maven-gpg-plugin + + + true + + org.apache.maven.plugins maven-install-plugin