https://github.com/python/cpython/commit/af0485186e3c74b195d8e9de5b2248840d6031b0
commit: af0485186e3c74b195d8e9de5b2248840d6031b0
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-07-24T20:28:55+02:00
summary:

[3.13] gh-141004: GHA: Run `check-c-api-docs` check on docs-only PRs 
(GH-143573) (#154640)

(cherry picked from commit e5b5a1580411fb9587af8974db68f0857033ba14)

Co-authored-by: Stan Ulbrych <[email protected]>

files:
A .github/workflows/reusable-check-c-api-docs.yml
M .github/workflows/build.yml

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c63452851079397..72ef043148b4251 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -185,9 +185,14 @@ jobs:
       - name: Check for unsupported C global variables
         if: github.event_name == 'pull_request'  # $GITHUB_EVENT_NAME
         run: make check-c-globals
-      - name: Check for undocumented C APIs
-        run: make check-c-api-docs
 
+  check-c-api-docs:
+    name: C API Docs
+    needs: build-context
+    if: >-
+      needs.build-context.outputs.run-tests == 'true'
+      || needs.build-context.outputs.run-docs == 'true'
+    uses: ./.github/workflows/reusable-check-c-api-docs.yml
 
   build-windows:
     name: >-
@@ -582,6 +587,7 @@ jobs:
     - check-docs
     - check-autoconf-regen
     - check-generated-files
+    - check-c-api-docs
     - build-windows
     - build-windows-msi
     - build-macos
@@ -614,6 +620,12 @@ jobs:
             '
             || ''
           }}
+          ${{
+            !fromJSON(needs.build-context.outputs.run-tests)
+            && !fromJSON(needs.build-context.outputs.run-docs)
+            && 'check-c-api-docs,'
+            || ''
+          }}
           ${{ !fromJSON(needs.build-context.outputs.run-windows-tests) && 
'build-windows,' || '' }}
           ${{
             !fromJSON(needs.build-context.outputs.run-ci-fuzz)
diff --git a/.github/workflows/reusable-check-c-api-docs.yml 
b/.github/workflows/reusable-check-c-api-docs.yml
new file mode 100644
index 000000000000000..db030c80008b1ed
--- /dev/null
+++ b/.github/workflows/reusable-check-c-api-docs.yml
@@ -0,0 +1,25 @@
+name: Reusable C API Docs Check
+
+on:
+  workflow_call:
+
+permissions:
+  contents: read
+
+env:
+  FORCE_COLOR: 1
+
+jobs:
+  check-c-api-docs:
+    name: 'Check if all C APIs are documented'
+    runs-on: ubuntu-latest
+    timeout-minutes: 5
+    steps:
+      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 
v7.0.0
+        with:
+          persist-credentials: false
+      - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # 
v6.2.0
+        with:
+          python-version: '3.x'
+      - name: Check for undocumented C APIs
+        run: python Tools/check-c-api-docs/main.py

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to