diff --git a/.github/workflows/check-online-doc-build.yml b/.github/workflows/check-online-doc-build.yml new file mode 100644 index 0000000..13c6d6a --- /dev/null +++ b/.github/workflows/check-online-doc-build.yml @@ -0,0 +1,24 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +name: Check Online Document Building +permissions: {} + +on: + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + steps: + - uses: actions/checkout@v4 + - name: Build Online Document + shell: bash + run: | + git config --local --get remote.origin.url + echo "build online doc" + bash scripts/build.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9c8bd2d..2a3bfc2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,4 +11,4 @@ Thank you for being a part of this journey. We can't wait to see what we can ach # Additional Content - [Code of Conduct](https://github.com/opea-project/docs/tree/main/community/CODE_OF_CONDUCT.md) -- [Security Policy](https://github.com/opea-project/docs/tree/main/community/SECURITY.md) \ No newline at end of file +- [Security Policy](https://github.com/opea-project/docs/tree/main/community/SECURITY.md) diff --git a/conf.py b/conf.py index 4316462..40e4637 100644 --- a/conf.py +++ b/conf.py @@ -114,6 +114,7 @@ ) } +show_warning_types = True # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/scripts/build.sh b/scripts/build.sh index 8967988..9cedec5 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -40,8 +40,8 @@ echo "Build HTML" cd docs make clean make html - retval=$? +echo "result = $retval" if [ $retval -ne 0 ]; then echo "make html is error" exit 1 diff --git a/scripts/filter-doc-log.sh b/scripts/filter-doc-log.sh index 61f2417..a7cbd90 100755 --- a/scripts/filter-doc-log.sh +++ b/scripts/filter-doc-log.sh @@ -9,7 +9,7 @@ # Only argument is the name of the log file saved by the build. KI_SCRIPT=scripts/filter-known-issues.py -CONFIG_DIR=.known-issues/doc +CONFIG_DIR=.known-issues/ LOG_FILE=$1 BUILDDIR=$(dirname $LOG_FILE) @@ -32,7 +32,7 @@ else fi if [ -s "${LOG_FILE}" ]; then - $KI_SCRIPT --config-dir ${CONFIG_DIR} ${LOG_FILE} > ${BUILDDIR}/doc.warnings 2>&1 + python3 $KI_SCRIPT --config-dir ${CONFIG_DIR} ${LOG_FILE} > ${BUILDDIR}/doc.warnings 2>&1 if [ -s ${BUILDDIR}/doc.warnings ]; then echo echo -e "${red}New errors/warnings found, please fix them:" @@ -41,7 +41,7 @@ if [ -s "${LOG_FILE}" ]; then echo cat ${BUILDDIR}/doc.warnings echo - exit 1 + exit 2 else echo -e "${green}No new errors/warnings." $TPUT sgr0 @@ -49,5 +49,5 @@ if [ -s "${LOG_FILE}" ]; then else echo "Error in $0: logfile \"${LOG_FILE}\" not found." - exit 1 + exit 3 fi diff --git a/scripts/filter-known-issues.py b/scripts/filter-known-issues.py index 79f56fd..256aa3b 100755 --- a/scripts/filter-known-issues.py +++ b/scripts/filter-known-issues.py @@ -113,12 +113,21 @@ def config_import(paths): _paths = [] # Go over the list, flush it if the user gave an empty path ("") for path in paths: + if not os.path.exists(path): + logging.debug("{} not exist".format(path)) + continue + if path == "" or path is None: logging.debug("flushing current config list: %s", _paths) _paths = [] else: _paths.append(path) logging.debug("config list: %s", _paths) + + if len(_paths)==0: + logging.debug("No available path") + assert(False) + for path in _paths: config_import_path(path) @@ -146,8 +155,7 @@ def config_import(paths): logging.basicConfig(level=40 - 10 * (args.verbosity - args.quiet), format="%(levelname)s: %(message)s") -path = ".known-issues/" -logging.debug("Reading configuration from directory `%s`", path) +logging.debug("Reading configuration from directory `%s`", args.config_dir) config_import(args.config_dir) exclude_ranges = []