mirror of
https://github.com/temporalio/temporal.git
synced 2026-08-30 18:41:49 -07:00
Fix GHA upload-test-results (#6091)
## What changed? <!-- Describe what has changed in this PR --> Separate test execution and test result upload. And check XML file exists. Previously introduced here https://github.com/temporalio/temporal/pull/6049 ## Why? <!-- Tell your future self why have you made these changes --> make aborts execution when the previous target fails. Oops. ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> Scenarios: - [x] no Buildkite secret set - [x] make target has test errors - [x] make target has no test errors - [x] make target aborts (no XML file written) ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) -->
This commit is contained in:
@@ -8,17 +8,18 @@ fi
|
||||
echo "uploading test results from $(pwd)"
|
||||
|
||||
for file in *.junit.xml; do
|
||||
echo "uploading ${file}"
|
||||
[ -e "$file" ] || continue
|
||||
echo "uploading ${file}"
|
||||
|
||||
curl -i -X POST \
|
||||
-H "Authorization: Token token=${BUILDKITE_ANALYTICS_TOKEN}" \
|
||||
-F "data=@${file}" \
|
||||
-F "format=junit" \
|
||||
-F "run_env[CI]=github_actions" \
|
||||
-F "run_env[key]=${GITHUB_ACTION}-${GITHUB_RUN_NUMBER}-${GITHUB_RUN_ATTEMPT}" \
|
||||
-F "run_env[number]=${GITHUB_RUN_NUMBER}" \
|
||||
-F "run_env[branch]=${GITHUB_REF}" \
|
||||
-F "run_env[commit_sha]=${GITHUB_SHA}" \
|
||||
-F "run_env[url]=https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" \
|
||||
https://analytics-api.buildkite.com/v1/uploads
|
||||
curl -i -X POST \
|
||||
-H "Authorization: Token token=${BUILDKITE_ANALYTICS_TOKEN}" \
|
||||
-F "data=@${file}" \
|
||||
-F "format=junit" \
|
||||
-F "run_env[CI]=github_actions" \
|
||||
-F "run_env[key]=${GITHUB_ACTION}-${GITHUB_RUN_NUMBER}-${GITHUB_RUN_ATTEMPT}" \
|
||||
-F "run_env[number]=${GITHUB_RUN_NUMBER}" \
|
||||
-F "run_env[branch]=${GITHUB_REF}" \
|
||||
-F "run_env[commit_sha]=${GITHUB_SHA}" \
|
||||
-F "run_env[url]=https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" \
|
||||
https://analytics-api.buildkite.com/v1/uploads
|
||||
done
|
||||
Reference in New Issue
Block a user