Skip to content

Commit

Permalink
add ci for build online doc (#241)
Browse files Browse the repository at this point in the history
* add ci for build online doc

* for debug

* for debug

* fix bug

* add print

Signed-off-by: ZhangJianyu <[email protected]>

* add print

* debug

* debug

* debug

* debug

* debug

* fix

* debug

* fix

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* rm write access

---------

Signed-off-by: ZhangJianyu <[email protected]>
Co-authored-by: ZhangJianyu <[email protected]>
  • Loading branch information
NeoZhangJianyu and arthw authored Nov 8, 2024
1 parent 14a07a5 commit 016942a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 8 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/check-online-doc-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
- [Security Policy](https://github.com/opea-project/docs/tree/main/community/SECURITY.md)
1 change: 1 addition & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions scripts/filter-doc-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:"
Expand All @@ -41,13 +41,13 @@ 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
fi

else
echo "Error in $0: logfile \"${LOG_FILE}\" not found."
exit 1
exit 3
fi
12 changes: 10 additions & 2 deletions scripts/filter-known-issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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 = []
Expand Down

0 comments on commit 016942a

Please sign in to comment.