Skip to content

Commit

Permalink
Extend the circle ci link check to include README.md (#1014)
Browse files Browse the repository at this point in the history
Temporarily directly add notebook into usecase section of documentation
to make sure the link on README.md is not broken.
  • Loading branch information
xzdandy committed Aug 31, 2023
1 parent c02f8c3 commit 94b3793
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 10 deletions.
8 changes: 5 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ jobs:
resource_class: large
docker:
# https://circleci.com/docs/circleci-images#language-image-variants
- image: "cimg/python:<< parameters.v >>"
- image: "cimg/python:<< parameters.v >>-node"
steps:

- checkout

# Restore pip wheel
- restore_cache:
keys:
- v1-pip-wheel_cache-python<< parameters.v >>-{{ checksum "docs/requirements.txt" }}
- v1-pip-wheel_cache-python<< parameters.v >>-{{ checksum "docs/requirements.txt" }}-{{ checksum "package-lock.json" }}

- run:
name: Install EvaDB Doc dependencies
Expand All @@ -259,6 +259,7 @@ jobs:
source test_evadb_doc/bin/activate
pip install --upgrade pip
pip install -r docs/requirements.txt
npm install markdown-link-check
- run:
name: Test doc build and link validation
Expand All @@ -268,9 +269,10 @@ jobs:
bash script/test/test.sh -m "<< parameters.mode >>"
- save_cache:
key: v1-pip-wheel_cache-python<< parameters.v >>-{{ checksum "docs/requirements.txt" }}
key: v1-pip-wheel_cache-python<< parameters.v >>-{{ checksum "docs/requirements.txt" }}-{{ checksum "package-lock.json" }}
paths:
- test_evadb_doc
- node_modules

Postgres:
parameters:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ We are a lean team on a mission to bring AI inside database systems! All kinds o

## License
Copyright (c) [Georgia Tech Database Group](http://db.cc.gatech.edu/).
Licensed under an [Apache License](LICENSE).
Licensed under an [Apache License](LICENSE.txt).
13 changes: 9 additions & 4 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ parts:
title: Q&A from Videos [ChatGPT + HuggingFace]
- file: source/usecases/food-review.rst
title: Sentiment Analysis and Response [ChatGPT + PostgreSQL]
- file: source/usecases/13-privategpt.ipynb
title: PrivateGPT
- file: source/usecases/08-chatgpt.ipynb
title: ChatGPT-based Video Question Answering
- file: source/usecases/12-query-pdf.ipynb
title: Querying PDF Documents
- file: source/usecases/02-object-detection.ipynb
title: Object Detection
title: Analysing Traffic Flow with YOLO
- file: source/usecases/03-emotion-analysis.ipynb
title: Emotion Analysis
title: Examining Emotions of Movie
- file: source/usecases/07-object-segmentation-huggingface.ipynb
title: Image Segmentation [HuggingFace]

title: Image Segmentation with Hugging Face

- caption: User Reference
chapters:
Expand Down
8 changes: 6 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,13 @@

for i in os.listdir("../tutorials"):
if i in [
"13-privategpt.ipynb",
"08-chatgpt.ipynb",
"12-query-pdf.ipynb",
"02-object-detection.ipynb",
"03-emotion-analysis.ipynb",
"07-object-segmentation-huggingface.ipynb"
"03-emotion-analysis.ipynb",
"07-object-segmentation-huggingface.ipynb",
"chatgpt.png",
]:
shutil.copy(f"../tutorials/{i}", "./source/usecases/")

Expand Down
7 changes: 7 additions & 0 deletions script/test/link_check_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ignorePatterns": [
{
"pattern": "^https://twitter.com"
}
]
}
11 changes: 11 additions & 0 deletions script/test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ check_doc_link() {
print_error_code $code "DOC LINK CHECK"
}

check_readme_link() {
if command -v npm > /dev/null && command -v npx >/dev/null && npm list --depth=0 | grep markdown-link-check; then
npx markdown-link-check -c ./script/test/link_check_config.json ./README.md
code=$?
print_error_code $code "README LINK CHECK"
else
echo "README LINK CHECK: --||-- SKIPPED (missing dependency: npm install markdown-link-check)"
fi
}

unit_test() {
PYTHONPATH=./ pytest test/unit_tests/ --durations=20 --cov-report term-missing:skip-covered --cov-config=.coveragerc --cov-context=test --cov=evadb/ --capture=sys --tb=short -v -rsf --log-level=WARNING -m "not benchmark"
code=$?
Expand Down Expand Up @@ -142,6 +152,7 @@ then
# Run black, isort, linter
check_doc_build
check_doc_link
check_readme_link
fi

##################################################
Expand Down

0 comments on commit 94b3793

Please sign in to comment.