@@ -76,42 +76,38 @@ runs:
76
76
mkdir -p $TMP_DIR
77
77
echo "TMP_DIR=$TMP_DIR" >> $GITHUB_ENV
78
78
79
- export LOG_DIR=$TMP_DIR/logs
80
- echo "LOG_DIR=$LOG_DIR" >> $GITHUB_ENV
81
- mkdir -p $LOG_DIR
79
+ # The whole dir will be uploaded to s3 with public (=wild internet) ACL
80
+ export PUBLIC_DIR=$TMP_DIR/results
81
+ echo "PUBLIC_DIR=$PUBLIC_DIR" >> $GITHUB_ENV
82
+ mkdir -p $PUBLIC_DIR
82
83
83
- export OUT_DIR =$TMP_DIR/out
84
- echo "OUT_DIR=$OUT_DIR " >> $GITHUB_ENV
85
- mkdir -p $OUT_DIR
84
+ export YA_MAKE_OUT_DIR =$TMP_DIR/out
85
+ echo "YA_MAKE_OUT_DIR=$YA_MAKE_OUT_DIR " >> $GITHUB_ENV
86
+ mkdir -p $YA_MAKE_OUT_DIR
86
87
87
- export ARTIFACTS_DIR=$TMP_DIR /artifacts
88
+ export ARTIFACTS_DIR=$PUBLIC_DIR /artifacts
88
89
echo "ARTIFACTS_DIR=$ARTIFACTS_DIR" >> $GITHUB_ENV
90
+ echo "ARTIFACTS_DIR_URL=$S3_URL_PREFIX/artifacts" >> $GITHUB_ENV
89
91
mkdir -p $ARTIFACTS_DIR
90
92
91
- export TEST_ARTIFACTS_DIR=$TMP_DIR /test_artifacts
93
+ export TEST_ARTIFACTS_DIR=$PUBLIC_DIR /test_artifacts
92
94
echo "TEST_ARTIFACTS_DIR=$TEST_ARTIFACTS_DIR" >> $GITHUB_ENV
95
+ echo "TEST_ARTIFACTS_DIR_URL=$S3_URL_PREFIX/test_artifacts" >> $GITHUB_ENV
93
96
mkdir -p $TEST_ARTIFACTS_DIR
94
97
95
- export REPORTS_ARTIFACTS_DIR=$TMP_DIR/artifacts/test_reports
96
- echo "REPORTS_ARTIFACTS_DIR=$REPORTS_ARTIFACTS_DIR" >> $GITHUB_ENV
97
- mkdir -p $REPORTS_ARTIFACTS_DIR
98
98
99
- export JUNIT_REPORT_PARTS=$TMP_DIR/junit-split
100
- echo "JUNIT_REPORT_PARTS=$JUNIT_REPORT_PARTS" >> $GITHUB_ENV
101
- mkdir -p $JUNIT_REPORT_PARTS
102
-
103
- echo "JUNIT_REPORT_XML=$TMP_DIR/junit.xml" >> $GITHUB_ENV
99
+ echo "JUNIT_REPORT_XML=$PUBLIC_DIR/junit.xml" >> $GITHUB_ENV
104
100
echo "TESTMO_URL=${{ inputs.testman_url }}" >> $GITHUB_ENV
105
- echo "SUMMARY_LINKS=$(mktemp) " >> $GITHUB_ENV
101
+ echo "SUMMARY_LINKS=$PUBLIC_DIR/summary_links.txt " >> $GITHUB_ENV
106
102
echo "BUILD_PRESET=${{ inputs.build_preset }}" >> $GITHUB_ENV
107
103
108
- echo "YA_TEST_LOG_FILENAME=$LOG_DIR/ya_test.log" >> $GITHUB_ENV
109
- echo "YA_TEST_LOG_URL=$S3_URL_PREFIX/test_logs/ya_test.log" >> $GITHUB_ENV
110
- echo "S3_LOG_BUCKET_PATH=$S3_BUCKET_PATH/test_logs" >> $GITHUB_ENV
104
+ echo "YA_TEST_LOG=$PUBLIC_DIR/ya_log.log" >> $GITHUB_ENV
105
+ echo "YA_TEST_LOG_URL=$S3_URL_PREFIX/ya_log.log" >> $GITHUB_ENV
111
106
112
- export log_url="$S3_URL_PREFIX/build_logs/ya_make.log"
113
- echo "LOG_URL=$log_url" >> $GITHUB_ENV
114
- echo "log_url=$log_url" >> $GITHUB_OUTPUT
107
+
108
+ echo YA_MAKE_OUTPUT="$PUBLIC_DIR/ya_make_output.log" >> $GITHUB_ENV
109
+ export YA_MAKE_OUTPUT_URL="$S3_URL_PREFIX/ya_make_output.log"
110
+ echo "YA_MAKE_OUTPUT_URL=$YA_MAKE_OUTPUT_URL" >> $GITHUB_ENV
115
111
116
112
# install test mo
117
113
npm install -g @testmo/testmo-cli
@@ -270,14 +266,14 @@ runs:
270
266
echo "Build+Tests **{platform_name}-${BUILD_PRESET}** is running..." | GITHUB_TOKEN="${{ github.token }}" .github/scripts/tests/comment-pr.py
271
267
set +ex
272
268
(./ya make ${{ inputs.build_target }} "${params[@]}" \
273
- --stat --log-file "$YA_TEST_LOG_FILENAME " -DCONSISTENT_DEBUG \
269
+ --stat --log-file "$YA_TEST_LOG " -DCONSISTENT_DEBUG \
274
270
--no-dir-outputs --test-failure-code 0 --build-all \
275
- --cache-size 2TB --force-build-depends --evlog-file "$TMP_DIR /ya_evlog.jsonl" \
276
- --junit "$JUNIT_REPORT_XML" --output "$OUT_DIR "; echo $? > exit_code) |& tee $TMP_DIR/ya_make.log
277
- set -ex
271
+ --cache-size 2TB --force-build-depends --evlog-file "$PUBLIC_DIR /ya_evlog.jsonl" \
272
+ --junit "$JUNIT_REPORT_XML" --output "$YA_MAKE_OUT_DIR "; echo $? > exit_code) |& tee $YA_MAKE_OUTPUT
273
+ set -e
278
274
RC=`cat exit_code`
279
275
280
- echo "10 [Ya make output]($LOG_URL )" >> $SUMMARY_LINKS
276
+ echo "10 [Ya make output]($YA_MAKE_OUTPUT_URL )" >> $SUMMARY_LINKS
281
277
echo "20 [Ya logs]($YA_TEST_LOG_URL)" >> $SUMMARY_LINKS
282
278
283
279
if [ $RC -ne 0 ]; then
@@ -300,7 +296,7 @@ runs:
300
296
curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{github.token}}" -H "X-GitHub-Api-Version: 2022-11-28" \
301
297
https://api.github.com/repos/${{github.repository}}/statuses/${{github.event.pull_request.head.sha}} \
302
298
-d '{"state":"failure","description":"The check has been failed","context":"build_${{inputs.build_preset}}"}'
303
- echo "Build failed. see the [logs]($LOG_URL )." | .github/scripts/tests/comment-pr.py --fail
299
+ echo "Build failed. see the [logs]($YA_MAKE_OUTPUT_URL )." | .github/scripts/tests/comment-pr.py --fail
304
300
else
305
301
curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{github.token}}" -H "X-GitHub-Api-Version: 2022-11-28" \
306
302
https://api.github.com/repos/${{github.repository}}/statuses/${{github.event.pull_request.head.sha}} \
@@ -314,22 +310,18 @@ runs:
314
310
run : |
315
311
set -x
316
312
# archive unitest reports (orig)
317
- gzip -c $JUNIT_REPORT_XML > $REPORTS_ARTIFACTS_DIR /orig_junit.xml.gz
313
+ gzip -c $JUNIT_REPORT_XML > $PUBLIC_DIR /orig_junit.xml.gz
318
314
319
315
# postprocess junit report
320
316
.github/scripts/tests/transform-ya-junit.py -i \
321
317
-m .github/config/muted_ya.txt \
322
- --ya-out "$OUT_DIR " \
323
- --log-url-prefix "$S3_URL_PREFIX /logs/" \
318
+ --ya-out "$YA_MAKE_OUT_DIR " \
319
+ --log-url-prefix "$ARTIFACTS_DIR_URL /logs/" \
324
320
--log-out-dir "$ARTIFACTS_DIR/logs/" \
325
321
--test-stuff-out "$TEST_ARTIFACTS_DIR/" \
326
- --test-stuff-prefix "$S3_TEST_ARTIFACTS_URL_PREFIX /" \
322
+ --test-stuff-prefix "$TEST_ARTIFACTS_DIR_URL /" \
327
323
"$JUNIT_REPORT_XML"
328
-
329
- .github/scripts/tests/split-junit.py -o "$JUNIT_REPORT_PARTS" "$JUNIT_REPORT_XML"
330
-
331
- # archive unitest reports (transformed)
332
- tar -C $JUNIT_REPORT_PARTS/.. -czf $REPORTS_ARTIFACTS_DIR/junit_parts.xml.tar.gz $(basename $JUNIT_REPORT_PARTS)
324
+
333
325
334
326
- name : Test history upload results to YDB
335
327
if : inputs.run_tests
@@ -360,6 +352,14 @@ runs:
360
352
TESTMO_TOKEN : ${{ inputs.testman_token }}
361
353
run : |
362
354
set -x
355
+
356
+ # split large junit_report
357
+ export JUNIT_REPORT_PARTS=$TMP_DIR/junit-split
358
+ mkdir -p $JUNIT_REPORT_PARTS
359
+ .github/scripts/tests/split-junit.py -o "$JUNIT_REPORT_PARTS" "$JUNIT_REPORT_XML"
360
+ # archive unitest reports (transformed)
361
+ tar -C $JUNIT_REPORT_PARTS/.. -czf $PUBLIC_DIR/junit_parts.xml.tar.gz $(basename $JUNIT_REPORT_PARTS)
362
+
363
363
PROXY_ADDR=127.0.0.1:8888
364
364
365
365
openssl req -x509 -newkey rsa:2048 \
@@ -388,16 +388,6 @@ runs:
388
388
TESTMO_TOKEN : ${{ inputs.testman_token }}
389
389
run : |
390
390
testmo automation:run:complete --instance "$TESTMO_URL" --run-id ${{ steps.th.outputs.runid }}
391
-
392
- - name : sync logs results to s3
393
- if : always()
394
- shell : bash
395
- run : |
396
- set -x
397
- echo "::group::s3-sync"
398
- s3cmd sync --follow-symlinks --acl-public --no-progress --stats --no-check-md5 "$LOG_DIR/" "$S3_LOG_BUCKET_PATH/"
399
- s3cmd sync --acl-public --no-progress --stats --no-check-md5 "$TMP_DIR/ya_make.log" "$S3_BUCKET_PATH/build_logs/"
400
- echo "::endgroup::"
401
391
402
392
- name : analyze tests results
403
393
shell : bash
@@ -414,12 +404,10 @@ runs:
414
404
fi
415
405
416
406
mkdir $ARTIFACTS_DIR/summary/
417
-
418
- cat $SUMMARY_LINKS | python3 -c 'import sys; print(" | ".join([v for _, v in sorted([l.strip().split(" ", 1) for l in sys.stdin], key=lambda a: (int(a[0]), a))]))' >> $GITHUB_STEP_SUMMARY
419
407
420
408
.github/scripts/tests/generate-summary.py \
421
409
--summary-out-path $ARTIFACTS_DIR/summary/ \
422
- --summary-url-prefix $S3_URL_PREFIX /summary/ \
410
+ --summary-url-prefix $ARTIFACTS_DIR_URL /summary/ \
423
411
--test-history-url "$TEST_HISTORY_URL" \
424
412
--test-log-url="$YA_TEST_LOG_URL" \
425
413
--build-preset "$BUILD_PRESET" \
@@ -439,23 +427,25 @@ runs:
439
427
if [[ $teststatus != "success" ]];then
440
428
echo "status=failed" >> $GITHUB_OUTPUT
441
429
fi
442
-
443
- - name : sync test results to s3
444
- if : always() && inputs.run_tests
445
- shell : bash
446
- run : |
447
- set -x
448
- echo "::group::s3-sync"
449
- s3cmd sync -r --follow-symlinks --acl-public --no-progress --stats --no-check-md5 "$ARTIFACTS_DIR/" "$S3_BUCKET_PATH/"
450
- s3cmd sync -r --follow-symlinks --acl-public --no-progress --stats --no-check-md5 "$TEST_ARTIFACTS_DIR/" "$S3_TEST_ARTIFACTS_BUCKET_PATH/"
451
- echo "::endgroup::"
452
430
453
431
- name : check test results
454
432
if : inputs.run_tests
455
433
shell : bash
456
434
run : |
457
435
.github/scripts/tests/fail-checker.py "$JUNIT_REPORT_XML"
458
436
437
+ - name : sync results to s3 and publish links
438
+ if : always()
439
+ shell : bash
440
+ run : |
441
+ set -x
442
+ echo "::group::s3-sync"
443
+ .github/scripts/Indexer/indexer.py -r "$PUBLIC_DIR/"
444
+ echo "00 [Workflow run results](${S3_URL_PREFIX}/index.html)" >> $SUMMARY_LINKS
445
+ s3cmd sync --follow-symlinks --acl-public --no-progress --stats --no-check-md5 "$PUBLIC_DIR/" "$S3_BUCKET_PATH/"
446
+ cat $SUMMARY_LINKS | python3 -c 'import sys; print(" | ".join([v for _, v in sorted([l.strip().split(" ", 1) for l in sys.stdin], key=lambda a: (int(a[0]), a))]))' >> $GITHUB_STEP_SUMMARY
447
+ echo "::endgroup::"
448
+
459
449
- name : show free space
460
450
if : always()
461
451
shell : bash
0 commit comments