-
Notifications
You must be signed in to change notification settings - Fork 3
248 lines (248 loc) · 10.6 KB
/
tests.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
name: tests
on:
push:
env:
NODE_VERSION: 18.3.0
jobs:
tests:
name: java-${{ matrix.java }} unit tests
if: github.event.inputs.trigger == ''
|| !startsWith(github.event.inputs.trigger, 'm')
|| !startsWith(github.event.inputs.trigger, 'M')
strategy:
matrix:
java: [17, 20]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v3
with:
# 'temurin' 'zulu' 'adopt' 'adopt-hotspot' 'adopt-openj9' 'liberica' 'microsoft'
distribution: 'temurin'
java-version: ${{ matrix.java }}
- uses: actions/cache@v3
with:
path: |
~/.m2
~/.npm
~/.node
~/.docker
~/.gradle
key: ${{ runner.os }}-build-${{ hashFiles('**/*gradle*', '**/pom.xml', '**/package.json', '**/package-lock.json') }}
- run: if [[ "" != `docker ps -aq` ]] ; then docker rm -f -v `docker ps -aq` ; fi
- run: cd $GITHUB_WORKSPACE ; ./mvnw
liquibase-r2dbc-spring-boot-starter-mariadb-example:
name: java-${{ matrix.java }} mariadb-example integration tests
if: github.event.inputs.trigger == ''
|| !startsWith(github.event.inputs.trigger, 'm')
|| !startsWith(github.event.inputs.trigger, 'M')
strategy:
matrix:
java: [17, 20]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- uses: actions/cache@v3
with:
path: |
~/.m2
~/.npm
~/.node
~/.docker
~/.gradle
key: ${{ runner.os }}-build-${{ hashFiles('**/*gradle*', '**/pom.xml', '**/package.json', '**/package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: sudo apt install -y httpie
- run: sudo rm -rfv ~/.m2/repository/io/github/daggerok/example ~/.m2/repository/io/github/daggerok/liquibase-r2dbc-spring-boot-starter*
- run: ./mvnw clean install -DskipTests
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f examples/h2/file spring-boot:start
- run: npm_config_yes=true npx wait-port 8003
- run: http --ignore-stdin get :8003
- run: http --ignore-stdin get :8003/api
- run: http --ignore-stdin get :8003/api/messages
- run: http --ignore-stdin post :8003/api/messages body=hey
- run: http --ignore-stdin get :8003/api/messages
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f examples/h2/file spring-boot:stop
liquibase-r2dbc-spring-boot-starter-h2-file-example:
name: java-${{ matrix.java }} h2 file example integration tests
if: github.event.inputs.trigger == ''
|| !startsWith(github.event.inputs.trigger, 'm')
|| !startsWith(github.event.inputs.trigger, 'M')
strategy:
matrix:
java: [17, 20]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- uses: actions/cache@v3
with:
path: |
~/.m2
~/.npm
~/.node
~/.docker
~/.gradle
key: ${{ runner.os }}-build-${{ hashFiles('**/*gradle*', '**/pom.xml', '**/package.json', '**/package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: sudo apt install -y httpie
- run: sudo rm -rfv ~/.m2/repository/io/github/daggerok/example ~/.m2/repository/io/github/daggerok/liquibase-r2dbc-spring-boot-starter*
- run: ./mvnw clean install -DskipTests
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f examples/h2/file spring-boot:start
- run: npm_config_yes=true npx wait-port 8003
- run: http --ignore-stdin get :8003
- run: http --ignore-stdin get :8003/api
- run: http --ignore-stdin get :8003/api/messages
- run: http --ignore-stdin post :8003/api/messages body=hey
- run: http --ignore-stdin get :8003/api/messages
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f examples/h2/file spring-boot:stop
liquibase-r2dbc-spring-boot-starter-h2-mem-example:
name: java-${{ matrix.java }} h2 mem integration tests
if: github.event.inputs.trigger == ''
|| !startsWith(github.event.inputs.trigger, 'm')
|| !startsWith(github.event.inputs.trigger, 'M')
strategy:
matrix:
java: [17, 20]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- uses: actions/cache@v3
with:
path: |
~/.m2
~/.npm
~/.node
~/.docker
~/.gradle
key: ${{ runner.os }}-build-${{ hashFiles('**/*gradle*', '**/pom.xml', '**/package.json', '**/package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: sudo apt install -y httpie
- run: sudo rm -rfv ~/.m2/repository/io/github/daggerok/example ~/.m2/repository/io/github/daggerok/liquibase-r2dbc-spring-boot-starter*
- run: ./mvnw clean install -DskipTests
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f examples/h2/mem spring-boot:start
- run: npm_config_yes=true npx wait-port 8004
- run: http --ignore-stdin get :8004
- run: http --ignore-stdin get :8004/api
- run: http --ignore-stdin get :8004/api/messages
- run: http --ignore-stdin post :8004/api/messages body=hey
- run: http --ignore-stdin get :8004/api/messages
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f examples/h2/mem spring-boot:stop
liquibase-r2dbc-spring-boot-starter-mysql-example:
name: java-${{ matrix.java }} mysql integration tests
if: github.event.inputs.trigger == ''
|| !startsWith(github.event.inputs.trigger, 'm')
|| !startsWith(github.event.inputs.trigger, 'M')
strategy:
matrix:
java: [17, 20]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- uses: actions/cache@v3
with:
path: |
~/.m2
~/.npm
~/.node
~/.docker
~/.gradle
key: ${{ runner.os }}-build-${{ hashFiles('**/*gradle*', '**/pom.xml', '**/package.json', '**/package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: sudo apt install -y httpie
- run: docker pull mysql:8.0.24
- run: if [[ "" != `docker ps -aq` ]] ; then docker rm -f -v `docker ps -aq` ; fi
- run: |
docker run -d --rm --name mysql --platform=linux/x86_64 \
--health-cmd='mysqladmin ping -h 127.0.0.1 -u $MYSQL_USER --password=$MYSQL_PASSWORD || exit 1' \
--health-start-period=1s --health-retries=1111 --health-interval=1s --health-timeout=5s \
-e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=database \
-e MYSQL_USER=user -e MYSQL_PASSWORD=password \
-p 3306:3306 \
mysql:8.0.24
- run: while [[ $(docker ps -n 1 -q -f health=healthy -f status=running | wc -l) -lt 1 ]] ; do sleep 3 ; echo -n '.' ; done ; sleep 15; echo 'MySQL is ready.'
- run: npm_config_yes=true npx wait-port 3306
- run: ./mvnw clean package -DskipTests
- run: |
rm -rfv $GITHUB_WORKSPACE/examples/mysql/target/{*.jar.original,*-sources.jar}
java -jar $GITHUB_WORKSPACE/examples/mysql/target/*.jar &
npm_config_yes=true npx wait-port 8001
- run: http --ignore-stdin get :8001
- run: http --ignore-stdin get :8001/api
- run: http --ignore-stdin get :8001/api/messages
- run: http --ignore-stdin post :8001/api/messages body=hey
- run: http --ignore-stdin get :8001/api/messages
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f examples/mysql spring-boot:stop
- run: cd $GITHUB_WORKSPACE ; docker stop mysql
liquibase-r2dbc-spring-boot-starter-postgres-example:
name: java-${{ matrix.java }} postgres integration tests
if: github.event.inputs.trigger == ''
|| !startsWith(github.event.inputs.trigger, 'm')
|| !startsWith(github.event.inputs.trigger, 'M')
strategy:
matrix:
java: [17, 20]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- uses: actions/cache@v3
with:
path: |
~/.m2
~/.npm
~/.node
~/.docker
~/.gradle
key: ${{ runner.os }}-build-${{ hashFiles('**/*gradle*', '**/pom.xml', '**/package.json', '**/package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: sudo apt install -y httpie
- run: docker pull postgres:14.3-alpine3.16
- run: if [[ "" != `docker ps -aq` ]] ; then docker rm -f -v `docker ps -aq` ; fi
- run: |
docker run -d --rm --name postgres -p 5432:5432 --platform=linux/x86_64 \
-e POSTGRES_PASSWORD=password -e POSTGRES_DB=database -e POSTGRES_USER=user \
--health-start-period=1s --health-retries=1111 --health-interval=1s --health-timeout=5s \
--health-cmd='pg_isready -h 127.0.0.1 -p 5432 -d $POSTGRES_DB -U $POSTGRES_USER || exit 1' \
postgres:14.3-alpine3.16
- run: while [[ $(docker ps -n 1 -q -f health=healthy -f status=running | wc -l) -lt 1 ]] ; do sleep 3 ; echo -n '.' ; done ; sleep 15; echo 'Postgres is ready.'
- run: npm_config_yes=true npx wait-port 5432
- run: sudo rm -rfv ~/.m2/repository/io/github/daggerok/example ~/.m2/repository/io/github/daggerok/liquibase-r2dbc-spring-boot-starter*
- run: ./mvnw clean install -DskipTests
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f examples/postgresql spring-boot:start
- run: npm_config_yes=true npx wait-port 8002
- run: http --ignore-stdin get :8002
- run: http --ignore-stdin get :8002/api
- run: http --ignore-stdin get :8002/api/messages
- run: http --ignore-stdin post :8002/api/messages body=hey
- run: http --ignore-stdin get :8002/api/messages
- run: cd $GITHUB_WORKSPACE ; ./mvnw -f examples/postgresql spring-boot:stop
- run: cd $GITHUB_WORKSPACE ; docker stop postgres