-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (139 loc) · 5.23 KB
/
posmulten-hibernate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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 }}'