From d34e9aca911835fb3a875f58d18ecdac7e60e410 Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Mon, 19 Feb 2024 11:49:30 -0800 Subject: [PATCH 1/3] Add linkcheck --- .github/workflows/link_check.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/link_check.yml diff --git a/.github/workflows/link_check.yml b/.github/workflows/link_check.yml new file mode 100644 index 000000000..736345c7c --- /dev/null +++ b/.github/workflows/link_check.yml @@ -0,0 +1,39 @@ +name: Check Links + +on: + pull_request: + branches: + - main + push: + branches: + - main + schedule: + - cron: '0 5 * * *' + workflow_dispatch: + +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Check links in Markdown files + uses: gaurav-nelson/github-action-markdown-link-check@v1 + + notebook-link-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -U pytest pytest-check-links langsmith langchain GitPython + - name: Check links in notebooks + env: + LANGCHAIN_API_KEY: test + run: pytest -o python_files=non_python_only --check-links --ignore="*.py" -k .ipynb --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*" . From 602b8960be086358c3249e70a75c06316f8a3583 Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Mon, 19 Feb 2024 11:53:17 -0800 Subject: [PATCH 2/3] v4 --- .github/workflows/link_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link_check.yml b/.github/workflows/link_check.yml index 736345c7c..0fc66a156 100644 --- a/.github/workflows/link_check.yml +++ b/.github/workflows/link_check.yml @@ -26,7 +26,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.x' - name: Install dependencies From 39db6375a6f632a7908187121de206a7b210e3e6 Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Mon, 19 Feb 2024 12:01:28 -0800 Subject: [PATCH 3/3] cleanup --- .github/workflows/link_check.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/link_check.yml b/.github/workflows/link_check.yml index 0fc66a156..d74d4eb4f 100644 --- a/.github/workflows/link_check.yml +++ b/.github/workflows/link_check.yml @@ -8,32 +8,40 @@ on: branches: - main schedule: - - cron: '0 5 * * *' + - cron: "0 5 * * *" workflow_dispatch: +env: + POETRY_VERSION: "1.7.1" + jobs: markdown-link-check: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Check links in Markdown files uses: gaurav-nelson/github-action-markdown-link-check@v1 notebook-link-check: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Set up Python 3.x + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/poetry_setup" with: - python-version: '3.x' + python-version: "3.x" + poetry-version: ${{ env.POETRY_VERSION }} + cache-key: core + - name: Install dependencies + shell: bash run: | python -m pip install --upgrade pip - pip install -U pytest pytest-check-links langsmith langchain GitPython + poetry install --with test + poetry pip install -U pytest pytest-check-links langsmith langchain GitPython - name: Check links in notebooks env: LANGCHAIN_API_KEY: test - run: pytest -o python_files=non_python_only --check-links --ignore="*.py" -k .ipynb --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*" . + shell: bash + run: poetry run pytest -o python_files=non_python_only --check-links --ignore="*.py" -k .ipynb --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*" .