#50 - Added jakarta.validation api dependency #173
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests for posmulten hibernate | |
on: | |
push: | |
jobs: | |
compilation_and_unit_tests: | |
runs-on: ubuntu-latest | |
name: "Compilation and unit tests" | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v2 | |
- uses: actions/setup-java@v3 | |
name: Set up JDK 11 | |
id: setupJava11 | |
with: | |
distribution: 'zulu' # See 'Supported distributions' for available options | |
java-version: '11' | |
- name: Set up JDK 1.8 | |
id: setupJava8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- uses: cactuslab/maven-toolchains-xml-action@v1 | |
with: | |
toolchains: | | |
[ | |
{"jdkVersion": "8", "jdkHome": "${{steps.setupJava8.outputs.path}}"}, | |
{"jdkVersion": "11", "jdkHome": "${{steps.setupJava11.outputs.path}}"} | |
] | |
- name: Build with Maven | |
run: ./mvnw clean install -DskipTests --quiet && ./mvnw test | |
# Test signing TODO | |
# signing_test: | |
# runs-on: ubuntu-latest | |
# name: "signing tests" | |
# steps: | |
# - name: Git checkout | |
# uses: actions/checkout@v2 | |
# - name: Set up JDK 1.8 | |
# uses: actions/setup-java@v1 | |
# with: | |
# java-version: 1.8 | |
# - name: Build with Maven | |
# run: ./deploy/release.sh | |
# env: | |
# GPG_KEYNAME: '${{ secrets.GPG_KEYNAME }}' | |
# GPG_PASSPHRASE: '${{ secrets.GPG_PASSPHRASE }}' | |
# ENCRYPTION_PASSWORD: '${{ secrets.ENCRYPTION_PASSWORD }}' | |
# GPG_PUBLIC_KEYNAME: '${{ secrets.GPG_PUBLIC_KEYNAME }}' | |
integraion_tests: | |
needs: [compilation_and_unit_tests] | |
runs-on: ubuntu-latest | |
name: "Integration and functional tests in hibernate5 module" | |
services: | |
postgres: | |
image: postgres:9.6 | |
env: | |
POSTGRES_DB: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
POSTGRES_HOST: localhost | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v2 | |
- uses: actions/setup-java@v3 | |
name: Set up JDK 11 | |
id: setupJava11 | |
with: | |
distribution: 'zulu' # See 'Supported distributions' for available options | |
java-version: '11' | |
- name: Set up JDK 1.8 | |
id: setupJava8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- uses: cactuslab/maven-toolchains-xml-action@v1 | |
with: | |
toolchains: | | |
[ | |
{"jdkVersion": "8", "jdkHome": "${{steps.setupJava8.outputs.path}}"}, | |
{"jdkVersion": "11", "jdkHome": "${{steps.setupJava11.outputs.path}}"} | |
] | |
- name: Install library for postgres | |
run: sudo apt-get update -y && sudo apt-get -y install libpq-dev postgresql-client | |
- name: Create database owner | |
run: export PGPASSWORD=postgres && psql -f 'test-utils/src/main/resources/create-database-owner.sql' -U postgres -h 127.0.0.1 | |
- name: Create database owner | |
run: export PGPASSWORD=postgres && psql -f 'test-utils/src/main/resources/create-database-user.sql' -U postgres -h 127.0.0.1 | |
- name: Create database | |
run: export PGPASSWORD=postgres && psql -f 'test-utils/src/main/resources/create-database.sql' -U postgres -h 127.0.0.1 | |
- name: Apply privileges to database user | |
run: export PGPASSWORD=postgres && psql -f 'test-utils/src/main/resources/grant-access-to-user.sql' -U postgres -h 127.0.0.1 | |
- name: Run tests | |
run: ./mvnw -DskipTests --quiet clean install && ./mvnw -pl :hibernate5-functional-tests,:hibernate6-functional-tests -P !unit-tests,integration-tests test | |
publish: | |
runs-on: ubuntu-latest | |
name: "Publish to the Maven Central Repository" | |
needs: [integraion_tests] | |
steps: | |
- name: Git checkout | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: actions/checkout@v2 | |
- uses: actions/setup-java@v3 | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Set up JDK 11 | |
id: setupJava11 | |
with: | |
distribution: 'zulu' # See 'Supported distributions' for available options | |
java-version: '11' | |
- name: Set up JDK 1.8 | |
if: startsWith(github.ref, 'refs/tags/v') | |
id: setupJava8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- uses: cactuslab/maven-toolchains-xml-action@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
toolchains: | | |
[ | |
{"jdkVersion": "8", "jdkHome": "${{steps.setupJava8.outputs.path}}"}, | |
{"jdkVersion": "11", "jdkHome": "${{steps.setupJava11.outputs.path}}"} | |
] | |
- name: Build with Maven | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: ./deploy/release.sh | |
env: | |
GPG_KEYNAME: '${{ secrets.GPG_KEYNAME }}' | |
GPG_PASSPHRASE: '${{ secrets.GPG_PASSPHRASE }}' | |
ENCRYPTION_PASSWORD: '${{ secrets.ENCRYPTION_PASSWORD }}' | |
GPG_PUBLIC_KEYNAME: '${{ secrets.GPG_PUBLIC_KEYNAME }}' | |
MAVEN_USERNAME: '${{ secrets.POSMULTEN_MAVEN_USERNAME }}' | |
MAVEN_PASSWORD: '${{ secrets.POSMULTEN_MAVEN_PASSWORD }}' |