Skip to content

Commit 68eb426

Browse files
committed
Merge branch 'main' into validate-api-version
2 parents 9e686be + 307fd54 commit 68eb426

54 files changed

Lines changed: 3094 additions & 418 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/get-job-id/action.yml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,44 @@ runs:
3030
# The script will first try to match by (name, runner_name), then fall back to name-only.
3131
run: |
3232
set -euo pipefail
33+
3334
job_url="https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/runs/${RUN_ID}/jobs?per_page=100"
34-
json=$(curl -sSL \
35-
-H "Accept: application/vnd.github+json" \
36-
-H "Authorization: Bearer $GITHUB_TOKEN" \
37-
"$job_url")
35+
max_retries=6
36+
job_id=""
37+
json=""
3838
39-
# Prefer matching both job name and the current runner name to disambiguate matrix jobs
40-
job_id=$(jq -r --arg name "$JOB_NAME" --arg runner "$RUNNER_NAME" '
41-
(.jobs // [])
42-
| map(select(.name == $name and (.runner_name // "") == $runner))
43-
| (.[0].id // empty)
44-
' <<< "$json" )
39+
for ((attempt = 1; attempt <= max_retries; attempt++)); do
40+
json=$(curl -sSL \
41+
-H "Accept: application/vnd.github+json" \
42+
-H "Authorization: Bearer $GITHUB_TOKEN" \
43+
"$job_url")
4544
46-
# Fallback: match by name only
47-
if [ -z "${job_id:-}" ]; then
48-
job_id=$(jq -r --arg name "$JOB_NAME" '
49-
(.jobs // []) | map(select(.name == $name)) | (.[0].id // empty)
45+
# Prefer matching both job name and the current runner name to disambiguate matrix jobs
46+
job_id=$(jq -r --arg name "$JOB_NAME" --arg runner "$RUNNER_NAME" '
47+
(.jobs // [])
48+
| map(select(.name == $name and (.runner_name // "") == $runner))
49+
| (.[0].id // empty)
5050
' <<< "$json" )
51-
fi
51+
52+
# Fallback: match by name only
53+
if [ -z "${job_id:-}" ]; then
54+
job_id=$(jq -r --arg name "$JOB_NAME" '
55+
(.jobs // []) | map(select(.name == $name)) | (.[0].id // empty)
56+
' <<< "$json" )
57+
fi
58+
59+
if [ -n "${job_id:-}" ] && [ "$job_id" != "null" ]; then
60+
break
61+
fi
62+
63+
if [ "$attempt" -lt "$max_retries" ]; then
64+
echo "::notice::Job ID for '$JOB_NAME' not visible yet (attempt $attempt/$max_retries); retrying in 5s"
65+
sleep 5
66+
fi
67+
done
5268
5369
if [ -z "${job_id:-}" ] || [ "$job_id" = "null" ]; then
54-
echo "::error::Failed to resolve job ID for name '$JOB_NAME' on runner '$RUNNER_NAME' in run '$RUN_ID'" >&2
70+
echo "::error::Failed to resolve job ID for name '$JOB_NAME' on runner '$RUNNER_NAME' in run '$RUN_ID' after retries" >&2
5571
exit 1
5672
fi
5773
echo "job_id=$job_id" >> "$GITHUB_OUTPUT"

.github/workflows/run-tests.yml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,13 @@ jobs:
328328
[ "$(find .testoutput -maxdepth 1 -name 'junit.*.xml' | wc -l)" -lt "$MAX_TEST_ATTEMPTS" ] &&
329329
CRASH_REPORT_NAME="$GITHUB_JOB" make report-test-crash
330330
331-
- name: Generate test summary
332-
uses: mikepenz/action-junit-report@v6
331+
- name: Write test summary
333332
if: ${{ !cancelled() }}
334-
with:
335-
report_paths: ./.testoutput/junit.*.xml
336-
detailed_summary: true
337-
check_annotations: false
338-
annotate_only: true
339-
skip_annotations: true
333+
run: |
334+
summary="$(make -s print-test-summary)"
335+
if [ -n "$summary" ]; then
336+
printf '%s\n' "$summary" > "$GITHUB_STEP_SUMMARY"
337+
fi
340338
341339
- name: Upload code coverage to Codecov
342340
uses: codecov/codecov-action@v5
@@ -428,15 +426,13 @@ jobs:
428426
[ "$(find .testoutput -maxdepth 1 -name 'junit.*.xml' | wc -l)" -lt "$MAX_TEST_ATTEMPTS" ] &&
429427
CRASH_REPORT_NAME="$GITHUB_JOB" make report-test-crash
430428
431-
- name: Generate test summary
432-
uses: mikepenz/action-junit-report@v6
429+
- name: Write test summary
433430
if: ${{ !cancelled() }}
434-
with:
435-
report_paths: ./.testoutput/junit.*.xml
436-
detailed_summary: true
437-
check_annotations: false
438-
annotate_only: true
439-
skip_annotations: true
431+
run: |
432+
summary="$(make -s print-test-summary)"
433+
if [ -n "$summary" ]; then
434+
printf '%s\n' "$summary" > "$GITHUB_STEP_SUMMARY"
435+
fi
440436
441437
- name: Upload code coverage to Codecov
442438
uses: codecov/codecov-action@v5
@@ -567,15 +563,13 @@ jobs:
567563
[ "$(find .testoutput -maxdepth 1 -name 'junit.*.xml' | wc -l)" -lt "$MAX_TEST_ATTEMPTS" ] &&
568564
CRASH_REPORT_NAME="$GITHUB_JOB" make report-test-crash
569565
570-
- name: Generate test summary
571-
uses: mikepenz/action-junit-report@v6
566+
- name: Write test summary
572567
if: ${{ !cancelled() }}
573-
with:
574-
report_paths: ./.testoutput/junit.*.xml
575-
detailed_summary: true
576-
check_annotations: false
577-
annotate_only: true
578-
skip_annotations: true
568+
run: |
569+
summary="$(make -s print-test-summary)"
570+
if [ -n "$summary" ]; then
571+
printf '%s\n' "$summary" > "$GITHUB_STEP_SUMMARY"
572+
fi
579573
580574
- name: Upload code coverage to Codecov
581575
uses: codecov/codecov-action@v5

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,10 @@ report-test-crash: $(TEST_OUTPUT_ROOT)
557557
--junitfile=$(TEST_OUTPUT_ROOT)/junit.crash.xml \
558558
--crashreportname=$(CRASH_REPORT_NAME)
559559

560+
print-test-summary: $(TEST_OUTPUT_ROOT)
561+
@go run ./cmd/tools/test-runner print-summary \
562+
--junit-glob=$(TEST_OUTPUT_ROOT)/junit.*.xml
563+
560564
##### Schema #####
561565
install-schema-cass-es: temporal-cassandra-tool install-schema-es
562566
@printf $(COLOR) "Install Cassandra schema..."
@@ -697,6 +701,10 @@ start-xdc-cluster-b: temporal-server
697701
start-xdc-cluster-c: temporal-server
698702
./temporal-server --config-file config/development-cluster-c.yaml --allow-no-auth start
699703

704+
start-jwt: temporal-server
705+
@./config/jwt/setup-keys.sh
706+
./temporal-server --config-file config/development-jwt.yaml start --service frontend --service internal-frontend --service history --service matching --service worker
707+
700708
##### Grafana #####
701709
update-dashboards:
702710
@printf $(COLOR) "Update dashboards submodule from remote..."

0 commit comments

Comments
 (0)