-
-
Notifications
You must be signed in to change notification settings - Fork 61
207 lines (201 loc) · 7.62 KB
/
ci.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
name: ci
on:
- pull_request
- push
- workflow_dispatch
env:
MAVEN_FLAGS: "-B -ff -Dcheck.skip-spotbugs=true -DskipTests=true"
MAVEN_OPTS: "-Xmx2G -XX:+ExitOnOutOfMemoryError -Dmaven.wagon.rto=60000"
jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 200
strategy:
fail-fast: false
matrix:
java-version:
- 11
- 17
java-distribution:
- temurin
suite:
- h2
- mysql
- postgresql
ref-api:
- refs/heads/master
ref-plugin-api:
- refs/heads/master
ref-commons:
- refs/heads/master
ref-plugin-framework-java:
- refs/heads/master
ref-platform:
- refs/heads/master
ref-client-java:
- refs/heads/master
ref-killbill:
- refs/heads/master
steps:
- name: Checkout killbill-oss-parent
uses: actions/checkout@v3
with:
repository: killbill/killbill-oss-parent
path: killbill-oss-parent
- name: Checkout killbill-api
uses: actions/checkout@v3
with:
repository: killbill/killbill-api
ref: ${{ matrix.ref-api }}
path: killbill-api
- name: Checkout killbill-plugin-api
uses: actions/checkout@v3
with:
repository: killbill/killbill-plugin-api
ref: ${{ matrix.ref-plugin-api }}
path: killbill-plugin-api
- name: Checkout killbill-commons
uses: actions/checkout@v3
with:
repository: killbill/killbill-commons
ref: ${{ matrix.ref-commons }}
path: killbill-commons
- name: Checkout killbill-plugin-framework-java
uses: actions/checkout@v3
with:
repository: killbill/killbill-plugin-framework-java
ref: ${{ matrix.ref-plugin-framework-java }}
path: killbill-plugin-framework-java
- name: Checkout killbill-platform
uses: actions/checkout@v3
with:
repository: killbill/killbill-platform
ref: ${{ matrix.ref-platform }}
path: killbill-platform
- name: Checkout killbill-client-java
uses: actions/checkout@v3
with:
repository: killbill/killbill-client-java
ref: ${{ matrix.ref-client-java }}
path: killbill-client-java
- name: Checkout killbill
uses: actions/checkout@v3
with:
repository: killbill/killbill
ref: ${{ matrix.ref-killbill }}
path: killbill
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.java-distribution }}
java-version: ${{ matrix.java-version }}
- name: Configure Sonatype mirror
uses: s4u/[email protected]
# Go to Sonatype directly to avoid delay syncs (could get rid of this if actions/setup-java were to support mirrors).
with:
mirrors: '[{"id": "oss-releases", "name": "Sonatype releases", "mirrorOf": "central", "url": "https://oss.sonatype.org/content/repositories/releases"}]'
sonatypeSnapshots: true
- name: Download dependencies and setup the various pom.xml
run: |
pushd $GITHUB_WORKSPACE/killbill-oss-parent
pomVersion=$(mvn ${MAVEN_FLAGS} help:evaluate -Dexpression=project.version -q -DforceStdout)
mvn ${MAVEN_FLAGS} clean install
popd
declare -A property=(
[killbill-api]=killbill-api.version
[killbill-plugin-api]=killbill-plugin-api.version
[killbill-commons]=killbill-commons.version
[killbill-plugin-framework-java]=killbill-base-plugin.version
[killbill-platform]=killbill-platform.version
[killbill-client-java]=killbill-client.version
)
for i in killbill-api killbill-plugin-api killbill-commons killbill-plugin-framework-java killbill-platform killbill-client-java; do
echo "::group::Update $i parent"
pushd $GITHUB_WORKSPACE/$i
echo "Resolving current $i version"
version=$(mvn ${MAVEN_FLAGS} help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Current $i version is $version"
echo "Updating $i parent pom.xml to $pomVersion"
mvn ${MAVEN_FLAGS} versions:update-parent -DallowSnapshots -DgenerateBackupPoms=false -DparentVersion="[$pomVersion]"
echo "$i pom.xml changes:"
git --no-pager diff
echo "Building $i"
mvn ${MAVEN_FLAGS} clean install
popd
echo "::endgroup::"
echo "::group::Update $i in killbill-oss-parent"
pushd $GITHUB_WORKSPACE/killbill-oss-parent
echo "Updating ${property[$i]} in parent pom.xml to $version"
mvn ${MAVEN_FLAGS} versions:set-property -Dproperty=${property[$i]} -DnewVersion=$version
echo "killbill-oss-parent pom.xml changes:"
git --no-pager diff
echo "Building killbill-oss-parent"
mvn ${MAVEN_FLAGS} clean install
popd
echo "::endgroup::"
done
- name: Build Kill Bill
run: |
pushd $GITHUB_WORKSPACE/killbill-oss-parent
pomVersion=$(mvn ${MAVEN_FLAGS} help:evaluate -Dexpression=project.version -q -DforceStdout)
popd
pushd $GITHUB_WORKSPACE/killbill
echo "Updating killbill parent pom.xml to $pomVersion"
mvn ${MAVEN_FLAGS} versions:update-parent -DallowSnapshots -DgenerateBackupPoms=false -DparentVersion="[$pomVersion]"
echo "Building killbill"
mvn ${MAVEN_FLAGS} clean install
popd
- name: Review base pom.xml changes
run: |
pushd $GITHUB_WORKSPACE/killbill-oss-parent
echo "killbill-oss-parent pom.xml changes:"
git --no-pager diff
popd
- name: Run killbill-commons tests
run: |
i=killbill-commons
pushd $GITHUB_WORKSPACE/$i
echo "$i pom.xml changes:"
git --no-pager diff
echo "Running $i ${{ matrix.suite }} tests"
# Flaky...
$GITHUB_WORKSPACE/killbill-oss-parent/bin/retry mvn clean install -P${{ matrix.suite }}
popd
- name: Run killbill-plugin-framework-java tests
run: |
i=killbill-plugin-framework-java
pushd $GITHUB_WORKSPACE/$i
echo "$i pom.xml changes:"
git --no-pager diff
echo "Running $i ${{ matrix.suite }} tests"
mvn clean install -P${{ matrix.suite }}
popd
- name: Run killbill-platform tests
run: |
i=killbill-platform
pushd $GITHUB_WORKSPACE/$i
echo "$i pom.xml changes:"
git --no-pager diff
echo "Running $i ${{ matrix.suite }} tests"
# Flaky...
$GITHUB_WORKSPACE/killbill-oss-parent/bin/retry mvn clean install -P${{ matrix.suite }}
popd
- name: Run killbill-client-java tests
run: |
i=killbill-client-java
pushd $GITHUB_WORKSPACE/$i
echo "$i pom.xml changes:"
git --no-pager diff
echo "Running $i ${{ matrix.suite }} tests"
mvn clean install -P${{ matrix.suite }}
popd
- name: Run killbill tests
run: |
i=killbill
pushd $GITHUB_WORKSPACE/$i
echo "$i pom.xml changes:"
git --no-pager diff
echo "Running $i ${{ matrix.suite }} tests"
# Flaky...
$GITHUB_WORKSPACE/killbill-oss-parent/bin/retry mvn clean install -P${{ matrix.suite }} -Dkillbill.test.apiListenerDelay=120000
popd