Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ci for build online doc #241

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/check-online-doc-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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: Prepare files (ignore error)
continue-on-error: true
shell: bash
run: |
mkdir opea
# mkdir opea/docs
# echo "mv docs' file/folder to opea/doc"
# ls -la
# echo "2"
# mv ./* opea/docs
# ls -la
# echo "3"
# ls -la opea/docs

- name: Build Online Document
shell: bash
run: |
git config --local --get remote.origin.url
echo "build online doc"
bash scripts/build.sh
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to OPEA
## Contributing to OPEA

Welcome to the OPEA open-source community! We are thrilled to have you here and excited about the potential contributions you can bring to the OPEA platform. Whether you are fixing bugs, adding new GenAI components, improving documentation, or sharing your unique use cases, your contributions are invaluable.

Expand All @@ -8,7 +8,7 @@ Please check the [Contributing guidelines](https://github.com/opea-project/docs/

Thank you for being a part of this journey. We can't wait to see what we can achieve together!

# Additional Content
## 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
14 changes: 10 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 @@ -31,8 +31,14 @@ else
green='\e[32m'
fi

pwd

ls -la

ls -la ${CONFIG_DIR}

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 +47,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
10 changes: 10 additions & 0 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 @@ -148,6 +157,7 @@ def config_import(paths):

path = ".known-issues/"
logging.debug("Reading configuration from directory `%s`", path)
print('args.config_dir', args.config_dir)
config_import(args.config_dir)

exclude_ranges = []
Expand Down
Loading