diff --git a/.github/workflows/run_notebooks.yml b/.github/workflows/run_notebooks.yml index d207370582dda..d523f5b270a2c 100644 --- a/.github/workflows/run_notebooks.yml +++ b/.github/workflows/run_notebooks.yml @@ -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: @@ -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 @@ -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' @@ -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: @@ -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