Update Refs to clean up syntax highlighting (#443)

This commit is contained in:
William FH
2024-05-13 18:32:42 -07:00
committed by GitHub
parent 2c32a38c42
commit f335105853
16 changed files with 493 additions and 280 deletions
+13 -6
View File
@@ -20,6 +20,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check links in Markdown files
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
@@ -41,19 +44,23 @@ jobs:
cache-key: core
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
poetry install --with test
poetry run pip install -U pytest pytest-check-links langsmith langchain GitPython
- name: Check links in notebooks
env:
LANGCHAIN_API_KEY: test
shell: bash
run: |
if [ "${{ github.event_name }}" != "schedule" ]; then
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep '\.ipynb$')
poetry run pytest -o python_files=non_python_only --check-links $CHANGED_FILES --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*" --check-links-ignore "https://x.com/.*"
git fetch origin main
CHANGED_FILES=$(git diff --name-only origin/main | grep '\.ipynb$')
if [ -n "$CHANGED_FILES" ]; then
poetry run pytest -o python_files=non_python_only --check-links --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*" --check-links-ignore "https://x.com/.*" $CHANGED_FILES
else
echo "No notebook files changed."
fi
else
poetry run pytest -o python_files=non_python_only --check-links --ignore="*.py" -k .ipynb --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*" --check-links-ignore "https://x.com/.*" ./examples
poetry run pytest -o python_files=non_python_only --check-links --ignore="*.py" -k .ipynb --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*" --check-links-ignore "https://x.com/.*" ./examples
fi