20
20
DOCKERFILE_PATH : docker/Dockerfile_java_cli
21
21
# Environment variable setting gradle options.
22
22
GRADLE_OPTS : " -XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false"
23
+ PUSHGATEWAY_HOSTNAME : monitoring.utbot.org
24
+ ELK_HOSTNAME : logs.utbot.org
25
+ FILEBEAT_DIR : /tmp/filebeat
23
26
24
27
jobs :
25
28
prepare-matrices :
59
62
fail-fast : false
60
63
matrix : ${{ fromJson(needs.prepare-matrices.outputs.framework-tests-matrix) }}
61
64
runs-on : ubuntu-20.04
62
- container : unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
65
+ container :
66
+ image : unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
67
+ volumes :
68
+ - " /home/runner/runners:/home/runner/runners"
69
+ - " /tmp/filebeat:/tmp/filebeat"
63
70
steps :
64
71
- name : Print environment variables
65
72
run : printenv
@@ -74,10 +81,19 @@ jobs:
74
81
git checkout ${{ github.event.inputs.commit_sha }}
75
82
76
83
- name : Run monitoring
84
+ # secret uploaded using base64 encoding to have one-line output:
85
+ # cat file | base64 -w 0
77
86
run : |
78
- echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"}
79
87
chmod +x ./scripts/project/monitoring.sh
80
- ./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }}
88
+ ./scripts/project/monitoring.sh "${PUSHGATEWAY_HOSTNAME}" "${{ secrets.PUSHGATEWAY_USER }}" "${{ secrets.PUSHGATEWAY_PASSWORD }}"
89
+ echo "Please visit Grafana to check metrics: https://${PUSHGATEWAY_HOSTNAME}/d/rYdddlPWk/node-exporter-full?orgId=1&from=now-1h&to=now&var-service=github&var-instance=${GITHUB_RUN_ID}-${HOSTNAME}&refresh=1m"
90
+ echo ---
91
+ printf ${{ secrets.CA_CERT }} | base64 -d > ${{ env.FILEBEAT_DIR }}/ca.crt
92
+ printf ${{ secrets.CLIENT_CRT }} | base64 -d > ${{ env.FILEBEAT_DIR }}/client.crt
93
+ printf ${{ secrets.CLIENT_KEY }} | base64 -d > ${{ env.FILEBEAT_DIR }}/client.key
94
+ chmod +x ./scripts/project/logging.sh
95
+ ./scripts/project/logging.sh "${FILEBEAT_DIR}" "${{ secrets.ELK_HOST }}:5044"
96
+ echo "Please visit ELK to check logs https://logs.utbot.org/app/discover#/ using the following search pattern: github.env.HOSTNAME:\"${HOSTNAME}\" and github.env.GITHUB_RUN_ID:\"${GITHUB_RUN_ID}\" and not github.log_level:\"INFO\""
81
97
82
98
# cache will use the key you provided and contains the files you specify in path.
83
99
#
@@ -125,17 +141,21 @@ jobs:
125
141
126
142
combined-projects :
127
143
# This job does not need to wait for 'prepare-tests-matrix' result.
128
- # GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them
144
+ # GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them
129
145
# to start execution early.
130
146
needs : prepare-matrices
131
- # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
147
+ # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
132
148
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
133
149
strategy :
134
150
# The option forces to execute all jobs even though some of them have failed.
135
151
fail-fast : false
136
152
matrix : ${{ fromJson(needs.prepare-matrices.outputs.combined-projects-matrix) }}
137
153
runs-on : ubuntu-20.04
138
- container : unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
154
+ container :
155
+ image : unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
156
+ volumes :
157
+ - " /home/runner/runners:/home/runner/runners"
158
+ - " /tmp/filebeat:/tmp/filebeat"
139
159
steps :
140
160
- name : Print environment variables
141
161
run : printenv
@@ -151,9 +171,16 @@ jobs:
151
171
152
172
- name : Run monitoring
153
173
run : |
154
- echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"}
155
174
chmod +x ./scripts/project/monitoring.sh
156
- ./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }}
175
+ ./scripts/project/monitoring.sh "${PUSHGATEWAY_HOSTNAME}" "${{ secrets.PUSHGATEWAY_USER }}" "${{ secrets.PUSHGATEWAY_PASSWORD }}"
176
+ echo "Please visit Grafana to check metrics: https://${PUSHGATEWAY_HOSTNAME}/d/rYdddlPWk/node-exporter-full?orgId=1&from=now-1h&to=now&var-service=github&var-instance=${GITHUB_RUN_ID}-${HOSTNAME}&refresh=1m"
177
+ echo ---
178
+ printf ${{ secrets.CA_CERT }} | base64 -d > ${{ env.FILEBEAT_DIR }}/ca.crt
179
+ printf ${{ secrets.CLIENT_CRT }} | base64 -d > ${{ env.FILEBEAT_DIR }}/client.crt
180
+ printf ${{ secrets.CLIENT_KEY }} | base64 -d > ${{ env.FILEBEAT_DIR }}/client.key
181
+ chmod +x ./scripts/project/logging.sh
182
+ ./scripts/project/logging.sh "${FILEBEAT_DIR}" "${{ secrets.ELK_HOST }}:5044"
183
+ echo "Please visit ELK to check logs https://logs.utbot.org/app/discover#/ using the following search pattern: github.env.HOSTNAME:\"${HOSTNAME}\" and github.env.GITHUB_RUN_ID:\"${GITHUB_RUN_ID}\" and not github.log_level:\"INFO\""
157
184
158
185
- uses : actions/cache@v3
159
186
with :
@@ -185,22 +212,26 @@ jobs:
185
212
with :
186
213
name : test_report ${{ matrix.projects.second }}
187
214
path : ${{ matrix.projects.second }}/build/reports/tests/test/*
188
-
215
+
189
216
190
217
single-project :
191
218
# This job does not need to wait for 'prepare-tests-matrix' result.
192
- # GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them
219
+ # GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them
193
220
# to start execution early.
194
221
needs : prepare-matrices
195
- # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
222
+ # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
196
223
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
197
224
strategy :
198
225
# The option forces to execute all jobs even though some of them have failed.
199
226
fail-fast : false
200
227
matrix :
201
228
project : [utbot-core, utbot-fuzzers, utbot-gradle, utbot-junit-contest, utbot-sample]
202
229
runs-on : ubuntu-20.04
203
- container : unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
230
+ container :
231
+ image : unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
232
+ volumes :
233
+ - " /home/runner/runners:/home/runner/runners"
234
+ - " /tmp/filebeat:/tmp/filebeat"
204
235
steps :
205
236
- name : Print environment variables
206
237
run : printenv
@@ -216,9 +247,16 @@ jobs:
216
247
217
248
- name : Run monitoring
218
249
run : |
219
- echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"}
220
250
chmod +x ./scripts/project/monitoring.sh
221
- ./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }}
251
+ ./scripts/project/monitoring.sh "${PUSHGATEWAY_HOSTNAME}" "${{ secrets.PUSHGATEWAY_USER }}" "${{ secrets.PUSHGATEWAY_PASSWORD }}"
252
+ echo "Please visit Grafana to check metrics: https://${PUSHGATEWAY_HOSTNAME}/d/rYdddlPWk/node-exporter-full?orgId=1&from=now-1h&to=now&var-service=github&var-instance=${GITHUB_RUN_ID}-${HOSTNAME}&refresh=1m"
253
+ echo ---
254
+ printf ${{ secrets.CA_CERT }} | base64 -d > ${{ env.FILEBEAT_DIR }}/ca.crt
255
+ printf ${{ secrets.CLIENT_CRT }} | base64 -d > ${{ env.FILEBEAT_DIR }}/client.crt
256
+ printf ${{ secrets.CLIENT_KEY }} | base64 -d > ${{ env.FILEBEAT_DIR }}/client.key
257
+ chmod +x ./scripts/project/logging.sh
258
+ ./scripts/project/logging.sh "${FILEBEAT_DIR}" "${{ secrets.ELK_HOST }}:5044"
259
+ echo "Please visit ELK to check logs https://logs.utbot.org/app/discover#/ using the following search pattern: github.env.HOSTNAME:\"${HOSTNAME}\" and github.env.GITHUB_RUN_ID:\"${GITHUB_RUN_ID}\" and not github.log_level:\"INFO\""
222
260
223
261
- uses : actions/cache@v3
224
262
with :
0 commit comments