95
95
key : lima-${{ steps.lima-actions-setup.outputs.version }}
96
96
97
97
- name : Selinux - Start Fedora VM with SELinux
98
- run : limactl start --plain --name=default --cpus=2 --disk=40 --memory=8 --network=lima:user-v2 template://fedora
98
+ run : limactl start --plain --name=default --cpus=4 --disk=40 --memory=8 --network=lima:user-v2 template://fedora
99
99
100
100
- name : Selinux - Setup SSH
101
101
uses : lima-vm/lima-actions/ssh@v1
@@ -201,17 +201,19 @@ jobs:
201
201
run : |
202
202
lima bash -c "cd ~/work/uutils/ && CI=1 bash util/run-gnu-test.sh run-root \$(cat selinux-tests.txt)"
203
203
204
- - name : Selinux - Extract testing info from indiv logs into JSON
204
+ - name : Selinux - Extract testing info from individual logs into JSON
205
205
shell : bash
206
206
run : |
207
- lima bash -c "cd ~/work/gnu/ && python3 ../uutils/util/gnu-json-result.py tests > tests-selinux/selinux-gnu-full-result.json && cat tests-selinux/selinux-gnu-full-result.json"
207
+ lima bash -c "mkdir -p ~/work/gnu/tests-selinux/"
208
+ lima bash -c "cd ~/work/gnu/ && python3 ../uutils/util/gnu-json-result.py tests"
209
+ lima bash -c "cd ~/work/gnu/ && python3 ../uutils/util/gnu-json-result.py tests > ~/work/gnu/tests-selinux/selinux-gnu-full-result.json && cat ~/work/gnu/tests-selinux/selinux-gnu-full-result.json"
208
210
209
211
- name : Selinux - Collect test logs and test results
210
212
run : |
211
213
mkdir -p ${{ steps.vars.outputs.path_GNU_tests }}-selinux
212
214
213
215
# Copy the test logs from the Lima VM to the host
214
- lima bash -c "mkdir -p ~/work/gnu/tests-selinux && cp ~/work/gnu/tests/test-suite.log ~/work/gnu/tests-selinux/ || echo 'No test-suite.log found'"
216
+ lima bash -c "cp ~/work/gnu/tests/test-suite.log ~/work/gnu/tests-selinux/ || echo 'No test-suite.log found'"
215
217
lima bash -c "cp ~/work/gnu/tests/test-suite-root.log ~/work/gnu/tests-selinux/ || echo 'No test-suite-root.log found'"
216
218
rsync -v -a -e ssh lima-default:~/work/gnu/tests-selinux/ ./${{ steps.vars.outputs.path_GNU_tests }}-selinux/
217
219
@@ -245,25 +247,27 @@ jobs:
245
247
run : |
246
248
## Extract/summarize testing info
247
249
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
248
- #
250
+
249
251
path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}'
250
- #
251
- SUITE_LOG_FILE='${{ steps.vars.outputs.SUITE_LOG_FILE }}'
252
- ROOT_SUITE_LOG_FILE='${{ steps.vars.outputs.ROOT_SUITE_LOG_FILE }}'
253
- SELINUX_SUITE_LOG_FILE='${{ steps.vars.outputs.SELINUX_SUITE_LOG_FILE }}'
254
- SELINUX_ROOT_SUITE_LOG_FILE='${{ steps.vars.outputs.SELINUX_ROOT_SUITE_LOG_FILE }}'
255
- ls -al ${SUITE_LOG_FILE} ${ROOT_SUITE_LOG_FILE} ${SELINUX_SUITE_LOG_FILE} ${SELINUX_ROOT_SUITE_LOG_FILE}
256
252
257
- if test -f "${SUITE_LOG_FILE}"
253
+ # Check if the file exists
254
+ if test -f "${{ steps.vars.outputs.TEST_FULL_SUMMARY_FILE }}"
258
255
then
259
- source ${path_UUTILS}/util/analyze-gnu-results.sh ${SUITE_LOG_FILE} ${ROOT_SUITE_LOG_FILE} ${SELINUX_SUITE_LOG_FILE} ${SELINUX_ROOT_SUITE_LOG_FILE}
256
+ # Run the Python script to analyze the JSON data
257
+ eval $(python3 ${path_UUTILS}/util/analyze-gnu-results.py ${{ steps.vars.outputs.TEST_FULL_SUMMARY_FILE }})
258
+
260
259
if [[ "$TOTAL" -eq 0 || "$TOTAL" -eq 1 ]]; then
261
- echo "::error ::Failed to parse test results from '${SUITE_LOG_FILE }'; failing early"
260
+ echo "::error ::Failed to parse test results from '${{ steps.vars.outputs.TEST_FULL_SUMMARY_FILE } }'; failing early"
262
261
exit 1
263
262
fi
263
+
264
264
output="GNU tests summary = TOTAL: $TOTAL / PASS: $PASS / FAIL: $FAIL / ERROR: $ERROR / SKIP: $SKIP"
265
265
echo "${output}"
266
- if [[ "$FAIL" -gt 0 || "$ERROR" -gt 0 ]]; then echo "::warning ::${output}" ; fi
266
+
267
+ if [[ "$FAIL" -gt 0 || "$ERROR" -gt 0 ]]; then
268
+ echo "::warning ::${output}"
269
+ fi
270
+
267
271
jq -n \
268
272
--arg date "$(date --rfc-email)" \
269
273
--arg sha "$GITHUB_SHA" \
@@ -277,9 +281,10 @@ jobs:
277
281
HASH=$(sha1sum '${{ steps.vars.outputs.TEST_SUMMARY_FILE }}' | cut --delim=" " -f 1)
278
282
outputs HASH
279
283
else
280
- echo "::error ::Failed to find summary of test results (missing '${SUITE_LOG_FILE }'); failing early"
284
+ echo "::error ::Failed to find summary of test results (missing '${{ steps.vars.outputs.TEST_FULL_SUMMARY_FILE } }'); failing early"
281
285
exit 1
282
286
fi
287
+
283
288
# Compress logs before upload (fails otherwise)
284
289
gzip ${{ steps.vars.outputs.TEST_LOGS_GLOB }}
285
290
- name : Reserve SHA1/ID of 'test-summary'
0 commit comments