build docs only when //|
matches
This commit is contained in:
parent
0e46c77c14
commit
8096c94e1b
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -153,6 +153,8 @@ jobs:
|
||||
id: set-matrix
|
||||
working-directory: tools
|
||||
env:
|
||||
BASE_SHA: ${{ steps.deepen-and-convert-depth-to-sha.outputs.commit }}
|
||||
HEAD_SHA: ${{ github.event.after }}
|
||||
CHANGED_FILES: ${{ steps.get-changes.outputs.changed_files }}
|
||||
LAST_FAILED_JOBS: ${{ steps.get-last-commit-with-checks.outputs.check_runs }}
|
||||
run: python3 -u ci_set_matrix.py
|
||||
|
@ -26,6 +26,7 @@ import os
|
||||
import sys
|
||||
import json
|
||||
import pathlib
|
||||
import subprocess
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
tools_dir = pathlib.Path(__file__).resolve().parent
|
||||
@ -238,6 +239,15 @@ def set_docs_to_build(build_all):
|
||||
r"^(?:.github/workflows/|docs|extmod/ulab|(?:(?:ports/\w+/bindings|shared-bindings)\S+\.c|conf\.py|tools/extract_pyi\.py|requirements-doc\.txt)$)|(?:-stubs|\.(?:md|MD|rst|RST))$"
|
||||
)
|
||||
for p in changed_files:
|
||||
if (
|
||||
p.endswith(".c")
|
||||
and not subprocess.run(
|
||||
f"git diff -U0 {os.environ.get('BASE_SHA')}...{os.environ.get('HEAD_SHA')} {p} | grep -o -m 1 '^[+-]\/\/|'",
|
||||
capture_output=True,
|
||||
shell=True,
|
||||
).stdout
|
||||
):
|
||||
continue
|
||||
if doc_pattern.search(p):
|
||||
doc_match = True
|
||||
break
|
||||
|
Loading…
x
Reference in New Issue
Block a user