Skip to content

Commit 79ab67e

Browse files
committed
ci: fix coverage deployment and add workflow concurrency
Coverage artifact download now queries the latest successful test run instead of relying solely on the workflow_run trigger event. Add concurrency group to the test workflow to prevent Docker port conflicts when multiple runs execute on the same runner.
1 parent 45ac231 commit 79ab67e

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,21 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v6
2525

26+
- name: Find latest successful test run
27+
id: find-run
28+
run: |
29+
RUN_ID=$(gh run list --workflow "Run tests" --branch main --status success --limit 1 --json databaseId --jq '.[0].databaseId')
30+
echo "run-id=$RUN_ID" >> "$GITHUB_OUTPUT"
31+
env:
32+
GH_TOKEN: ${{ github.token }}
33+
2634
- name: Download coverage artifact
27-
if: github.event_name == 'workflow_run'
35+
if: steps.find-run.outputs.run-id != ''
2836
uses: actions/download-artifact@v8
2937
with:
3038
name: coverage-report
3139
path: docs/public/coverage
32-
run-id: ${{ github.event.workflow_run.id }}
40+
run-id: ${{ steps.find-run.outputs.run-id }}
3341
github-token: ${{ github.token }}
3442
continue-on-error: true
3543

.github/workflows/run_tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ permissions:
3030
env:
3131
COVERAGE_REPORT_PATH: htmlcov
3232

33+
concurrency:
34+
group: ${{ github.workflow }}-${{ github.ref }}
35+
cancel-in-progress: true
36+
3337
jobs:
3438
CheckCoverage:
3539
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)