Skip to content

Commit 3f2036d

Browse files
exploreriiiAntonioCeppellini
authored andcommitted
ci: small improvements workflows (hiero-ledger#2075)
Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
1 parent bbd5a3d commit 3f2036d

7 files changed

Lines changed: 49 additions & 20 deletions

.github/workflows/bot-workflows.yml renamed to .github/workflows/pr-check-feedback-all.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ on:
33
workflow_dispatch:
44
workflow_run:
55
workflows:
6-
- "PR Formatting"
7-
- "PR Changelog Check"
8-
- "Hiero Solo Integration & Unit Tests"
9-
- "Run Examples"
6+
- "Primary PR Check – Broken Markdown Links"
7+
- "Primary PR Check - Code-coverage"
8+
- "Primary PR Check - Test Files Naming"
9+
- "Secondary PR Check - Examples"
10+
- "Secondary PR Check - TCK Unit Test"
11+
- "Secondary PR Check - Hiero Solo Integration & Unit Tests"
12+
- "Secondary PR Check - Dependency Compatibility"
1013
types:
1114
- completed
1215
permissions:
@@ -46,6 +49,7 @@ jobs:
4649
run: |
4750
REPO="${{ github.repository }}"
4851
COMMENT=$(cat <<EOF
52+
<!-- workflow-failure-bot -->
4953
Hi, this is WorkflowBot.
5054
Your pull request cannot be merged as it is not passing all our workflow checks.
5155
Please click on each check to review the logs and resolve issues so all checks pass.
@@ -61,7 +65,7 @@ jobs:
6165
EOF
6266
)
6367
EXISTING_COMMENT=$(gh pr view "$PR_NUMBER" --repo "$REPO" --comments \
64-
--json comments --jq ".comments[] | select(.body == \"${COMMENT//\"/\\\"}\") | .id")
68+
--json comments --jq '.comments[] | select(.body | contains("<!-- workflow-failure-bot -->")) | .id')
6569
6670
if [ -z "$EXISTING_COMMENT" ]; then
6771
gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$COMMENT"

.github/workflows/pr-check-broken-links.yml renamed to .github/workflows/pr-check-primary-broken-links.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
name: PR Check – Broken Markdown Links
1+
name: Primary PR Check – Broken Markdown Links
22

33
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "**/*.md"
48
pull_request:
59
paths:
610
- "**/*.md"
711

812
permissions:
913
contents: read
1014

15+
concurrency:
16+
group: pr-markdown-links-${{ github.event.pull_request.number }}
17+
cancel-in-progress: true
18+
1119
jobs:
1220
pr-check-broken-links:
13-
runs-on: hl-sdk-py-lin-md
21+
runs-on: ${{ (github.event.pull_request.head.repo.full_name == github.repository && github.repository_owner == 'hiero-ledger') && 'hl-sdk-py-lin-md' || 'ubuntu-latest' }}
1422

1523
steps:
1624
- name: Harden runner (audit outbound calls)

.github/workflows/pr-check-codecov.yml renamed to .github/workflows/pr-check-primary-codecov.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
name: Code Coverage
1+
name: Primary PR Check - Code-coverage
22

33
on:
44
push:
55
branches: [main]
6+
paths:
7+
- "src/**"
8+
- "tests/unit/**"
69
pull_request:
10+
paths:
11+
- "src/**"
12+
- "tests/unit/**"
713

814
permissions:
915
contents: read

.github/workflows/pr-check-test-files.yml renamed to .github/workflows/pr-check-primary-test-files.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
name: Test Files Naming Check
1+
# This workflow checks that all test files in the repository follow the naming convention of ending with "_test.py".
2+
name: Primary PR Check - Test Files Naming
23

34
on:
45
push:
5-
branches-ignore:
6-
- main
6+
branches: [main]
7+
paths:
8+
- "tests/**"
9+
pull_request:
10+
types: [opened, synchronize, review_requested, ready_for_review, reopened]
11+
paths:
12+
- "tests/**"
713

814
permissions:
915
contents: read

.github/workflows/deps-check.yml renamed to .github/workflows/pr-check-secondary-deps-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Dependency Compatibility Check
1+
name: Secondary PR Check - Dependency Compatibility
22

33
on:
44
push:
@@ -26,7 +26,7 @@ jobs:
2626
uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0
2727
with:
2828
egress-policy: audit
29-
29+
3030
- name: Checkout repository
3131
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3232

.github/workflows/pr-check-examples.yml renamed to .github/workflows/pr-check-secondary-examples.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Run Examples
1+
name: Secondary PR Check - Examples
22
permissions:
33
contents: read
44

55
on:
66
push:
7-
branches:
7+
branches:
88
- "**"
99
pull_request:
1010
workflow_dispatch:
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
2323
with:
2424
fetch-depth: 0
25-
25+
2626
- name: Install uv
2727
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
2828

.github/workflows/tck-test.yml renamed to .github/workflows/pr-check-secondary-tck-test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
1-
name: TCK Unit Test
1+
name: Secondary PR Check - TCK Unit Test
22

33
on:
44
push:
55
branches:
66
- "main"
77
paths:
8+
- "src/**"
89
- "tck/**"
910
- "tests/tck/**"
1011
pull_request:
1112
paths:
13+
- "src/**"
1214
- "tck/**"
1315
- "tests/tck/**"
1416
workflow_dispatch: {}
1517

1618
permissions:
1719
contents: read
1820

21+
concurrency:
22+
group: tck-${{ github.event.pull_request.number || github.ref }}
23+
cancel-in-progress: true
1924

2025
jobs:
2126
tck-unit-test:
22-
name: Tck Unit Test
27+
name: TCK Unit Test
2328
runs-on: hl-sdk-py-lin-md
2429

2530
steps:
2631
- name: Harden the runner (Audit all outbound calls)
2732
uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0
2833
with:
2934
egress-policy: audit
30-
35+
3136
- name: Checkout repository
3237
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3338

@@ -46,7 +51,7 @@ jobs:
4651

4752
- name: Generate Proto Files
4853
run: uv run generate_proto.py
49-
54+
5055
- name: Run unit tests
5156
run: |
5257
uv run pytest tests/tck -v

0 commit comments

Comments
 (0)