Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme committed Oct 23, 2024
1 parent d0fedee commit b2b92e8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/run_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: false
default: '3.11'
working-directory:
description: 'Working directory or subset (e.g., docs/docs/tutorials/llm_chain.ipynb)'
description: 'Working directory or subset (e.g., docs/docs/tutorials/llm_chain.ipynb or docs/docs/how_to)'
required: false
default: 'all'
schedule:
Expand All @@ -22,6 +22,12 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'langchain-ai/langchain' || github.event_name != 'schedule'
name: "Test docs"
strategy:
matrix:
working-directory: [docs/docs/how_to, docs/docs/tutorials]
include:
- working-directory: ${{ github.event.inputs.working-directory || 'all' }}
run-matrix: ${{ github.event.inputs.working-directory == 'all' || github.event_name == 'schedule' }}
steps:
- uses: actions/checkout@v4

Expand All @@ -30,7 +36,7 @@ jobs:
with:
python-version: ${{ github.event.inputs.python_version || '3.11' }}
poetry-version: ${{ env.POETRY_VERSION }}
working-directory: ${{ inputs.working-directory }}
working-directory: ${{ matrix.working-directory }}
cache-key: run-notebooks

- name: 'Authenticate to Google Cloud'
Expand Down Expand Up @@ -58,7 +64,7 @@ jobs:
- name: Prepare notebooks
run: |
poetry run python docs/scripts/prepare_notebooks_for_ci.py --comment-install-cells --working-directory ${{ github.event.inputs.working-directory || 'all' }}
poetry run python docs/scripts/prepare_notebooks_for_ci.py --comment-install-cells --working-directory ${{ matrix.working-directory }}
- name: Run notebooks
env:
Expand All @@ -69,6 +75,6 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }}
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
WORKING_DIRECTORY: ${{ github.event.inputs.working-directory || 'all' }}
WORKING_DIRECTORY: ${{ matrix.working-directory }}
run: |
./docs/scripts/execute_notebooks.sh $WORKING_DIRECTORY

0 comments on commit b2b92e8

Please sign in to comment.