Skip to content

Commit e5b5a15

Browse files
gh-141004: GHA: Run check-c-api-docs check on docs-only PRs (GH-143573)
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
1 parent cbf9b8c commit e5b5a15

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,14 @@ jobs:
142142
- name: Check for unsupported C global variables
143143
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
144144
run: make check-c-globals
145-
- name: Check for undocumented C APIs
146-
run: make check-c-api-docs
147145

146+
check-c-api-docs:
147+
name: C API Docs
148+
needs: build-context
149+
if: >-
150+
needs.build-context.outputs.run-tests == 'true'
151+
|| needs.build-context.outputs.run-docs == 'true'
152+
uses: ./.github/workflows/reusable-check-c-api-docs.yml
148153

149154
build-windows:
150155
name: >-
@@ -685,6 +690,7 @@ jobs:
685690
- check-docs
686691
- check-autoconf-regen
687692
- check-generated-files
693+
- check-c-api-docs
688694
- build-windows
689695
- build-windows-msi
690696
- build-macos
@@ -721,6 +727,12 @@ jobs:
721727
'
722728
|| ''
723729
}}
730+
${{
731+
!fromJSON(needs.build-context.outputs.run-tests)
732+
&& !fromJSON(needs.build-context.outputs.run-docs)
733+
&& 'check-c-api-docs,'
734+
|| ''
735+
}}
724736
${{ !fromJSON(needs.build-context.outputs.run-windows-tests) && 'build-windows,' || '' }}
725737
${{ !fromJSON(needs.build-context.outputs.run-ci-fuzz) && 'cifuzz,' || '' }}
726738
${{ !fromJSON(needs.build-context.outputs.run-macos) && 'build-macos,' || '' }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Reusable C API Docs Check
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
env:
10+
FORCE_COLOR: 1
11+
12+
jobs:
13+
check-c-api-docs:
14+
name: 'Check if all C APIs are documented'
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 5
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
persist-credentials: false
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.x'
24+
- name: Check for undocumented C APIs
25+
run: python Tools/check-c-api-docs/main.py

0 commit comments

Comments
 (0)