forked from alexandru-slobodcicov/liquibase-mongodb
-
Notifications
You must be signed in to change notification settings - Fork 47
178 lines (161 loc) · 5.08 KB
/
test.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
name: Build and Test
on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
build-test:
uses: liquibase/build-logic/.github/workflows/[email protected]
secrets: inherit
integration-tests:
name: Integration Test - Java ${{ matrix.java }} MongoDB ${{ matrix.mongodb }}
runs-on: ubuntu-latest
env:
LIQUIBOT_TOKEN: ${{ secrets.LIQUIBOT_PAT }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
strategy:
matrix:
java: [8, 11, 17]
mongodb: [5, 6, 7]
services:
mongodb:
image: mongo:${{ matrix.mongodb }}
ports:
- 27017-27019:27017-27019
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
# look for dependencies in maven
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v22
with:
repositories: |
[
{
"id": "liquibase",
"url": "https://maven.pkg.github.com/liquibase/liquibase",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
},
{
"id": "liquibase-pro",
"url": "https://maven.pkg.github.com/liquibase/liquibase-pro",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
}
]
servers: |
[
{
"id": "liquibase-pro",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
},
{
"id": "liquibase",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
}
]
- name: Integration Test - Java ${{ matrix.java }}
run: mvn -B clean test verify -Prun-its --file pom.xml
harness-tests:
name: Harness Tests - Java ${{ matrix.java }} MongoDB ${{ matrix.mongodb }}
runs-on: ubuntu-latest
env:
LIQUIBOT_TOKEN: ${{ secrets.LIQUIBOT_PAT }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
strategy:
matrix:
java: [ 11, 17 ]
mongodb: [5, 6, 7]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
# look for dependencies in maven
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v22
with:
repositories: |
[
{
"id": "liquibase",
"url": "https://maven.pkg.github.com/liquibase/liquibase",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
},
{
"id": "liquibase-pro",
"url": "https://maven.pkg.github.com/liquibase/liquibase-pro",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
}
]
servers: |
[
{
"id": "liquibase-pro",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
},
{
"id": "liquibase",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
}
]
- name: Build Cache
uses: actions/[email protected]
with:
key: build-${{ github.run_number }}-${{ github.run_attempt }}
path: |
**/target/**
~/.m2/repository/org/liquibase/
- name: Start Database
run: |
docker ps -a
docker-compose -f ./src/test/resources/docker/docker-compose.yml up -d mongo-${{ matrix.mongodb }}
docker ps -a
- name: Harness Foundational Test Suite Run on Docker - Java ${{ matrix.java }}
run: mvn -Dtest="HarnessNoSqlCompatibility" -DdbName=mongodb clean package -DdbVersion=${{ matrix.mongodb }}
- name: Stop Docker Databases
if: always()
run: docker-compose -f ./src/test/resources/docker/docker-compose.yml down mongo-${{ matrix.mongodb }}
- name: Archive Mongo Database Test Results
uses: actions/upload-artifact@v4
with:
name: mongodb-test-results
path: build/spock-reports