@@ -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 : >-
@@ -586,45 +591,45 @@ jobs:
586591 run : |
587592 "$BUILD_DIR/cross-python/bin/python3" -m test test_sysconfig test_site test_embed
588593
589- # CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
590594 cifuzz :
591- name : CIFuzz
592- runs-on : ubuntu-latest
593- timeout-minutes : 60
595+ # ${{ '' } is a hack to nest jobs under the same sidebar category.
596+ name : CIFuzz${{ '' }} # zizmor: ignore[obfuscation]
594597 needs : build-context
595- if : needs.build-context.outputs.run-ci-fuzz == 'true'
598+ if : >-
599+ needs.build-context.outputs.run-ci-fuzz == 'true'
600+ || needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
596601 permissions :
597602 security-events : write
598603 strategy :
599604 fail-fast : false
600605 matrix :
601- sanitizer : [address, undefined, memory]
602- steps :
603- - name : Build fuzzers (${{ matrix.sanitizer }})
604- id : build
605- uses : google/ oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
606- with :
607- oss-fuzz-project-name : cpython3
608- sanitizer : ${{ matrix.sanitizer }}
609- - name : Run fuzzers (${{ matrix.sanitizer }})
610- uses : google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
611- with :
612- fuzz-seconds : 600
613- oss-fuzz-project-name : cpython3
614- output-sarif : true
615- sanitizer : ${{ matrix.sanitizer }}
616- - name : Upload crash
617- if : failure() && steps.build.outcome == 'success'
618- uses : actions/upload-artifact@v6
619- with :
620- name : ${{ matrix.sanitizer }}-artifacts
621- path : ./out/artifacts
622- - name : Upload SARIF
623- if : always() && steps.build.outcome == 'success'
624- uses : github/codeql-action/upload-sarif@v3
625- with :
626- sarif_file : cifuzz-sarif/results.sarif
627- checkout_path : cifuzz-sarif
606+ sanitizer :
607+ - address
608+ - undefined
609+ - memory
610+ oss-fuzz-project-name :
611+ - cpython3
612+ - python3-libraries
613+ exclude :
614+ # Note that the 'no-exclude' sentinel below is to prevent
615+ # an empty string value from excluding all jobs and causing
616+ # GHA to create a 'default' matrix entry with all empty values.
617+ - oss- fuzz-project-name : >-
618+ ${{
619+ needs.build-context.outputs.run-ci-fuzz == ' true'
620+ && 'no-exclude'
621+ || 'cpython3'
622+ }}
623+ - oss-fuzz-project-name : >-
624+ ${{
625+ needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
626+ && 'no-exclude'
627+ || 'python3-libraries'
628+ }}
629+ uses : ./. github/workflows/reusable-cifuzz.yml
630+ with :
631+ oss-fuzz-project-name : ${{ matrix.oss-fuzz-project-name }}
632+ sanitizer : ${{ matrix.sanitizer }}
628633
629634 all-required-green : # This job does nothing and is only used for the branch protection
630635 name : All required checks pass
@@ -635,6 +640,7 @@ jobs:
635640 - check-docs
636641 - check-autoconf-regen
637642 - check-generated-files
643+ - check-c-api-docs
638644 - build-windows
639645 - build-windows-msi
640646 - build-macos
@@ -669,8 +675,19 @@ jobs:
669675 '
670676 || ''
671677 }}
678+ ${{
679+ !fromJSON(needs.build-context.outputs.run-tests)
680+ && !fromJSON(needs.build-context.outputs.run-docs)
681+ && 'check-c-api-docs,'
682+ || ''
683+ }}
672684 ${{ !fromJSON(needs.build-context.outputs.run-windows-tests) && 'build-windows,' || '' }}
673- ${{ !fromJSON(needs.build-context.outputs.run-ci-fuzz) && 'cifuzz,' || '' }}
685+ ${{
686+ !fromJSON(needs.build-context.outputs.run-ci-fuzz)
687+ && !fromJSON(needs.build-context.outputs.run-ci-fuzz-stdlib)
688+ && 'cifuzz,' ||
689+ ''
690+ }}
674691 ${{ !fromJSON(needs.build-context.outputs.run-macos) && 'build-macos,' || '' }}
675692 ${{
676693 !fromJSON(needs.build-context.outputs.run-ubuntu)
0 commit comments