Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/langchain-ai/langgraphjs in…
Browse files Browse the repository at this point in the history
…to jacob/loop
  • Loading branch information
jacoblee93 committed Aug 20, 2024
2 parents fbfaa1e + b4ccbe2 commit 2a4dbe7
Show file tree
Hide file tree
Showing 29 changed files with 3,537 additions and 2,325 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/validate-new-notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Validate new notebooks

# If another push to the same PR or branch happens while this workflow is still running,
# cancel the earlier run in favor of the next run.
#
# There's no point in testing an outdated version of the code. GitHub only allows
# a limited number of job runners to be active at the same time, so it's better to cancel
# pointless jobs early so that more useful jobs can run sooner.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- 'docs/docs/**'
- 'examples/**'
- 'deno.json'
workflow_dispatch:

env:
NODE_VERSION: "22.4.1"

jobs:
validate-dep-files:
name: Validate Deno and Node dependencies in sync
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Validate
run: yarn tsx --experimental-wasm-modules ./scripts/validate_deps_sync.ts

jobs:
validate-new-notebooks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
- name: Check for new or modified notebooks
id: check_notebooks
run: |
notebooks=$(echo '${{ steps.changed-files.outputs.all_changed_files }}' | tr ' ' '\n' | grep -E '^(docs/docs|examples)/.*\.ipynb$' || true)
echo "Affected notebooks: $notebooks"
echo "has_affected_notebooks=$([ -n "$notebooks" ] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
- name: Build LangGraph
if: steps.check_notebooks.outputs.has_affected_notebooks == 'true'
run: yarn build
- name: Validate affected notebooks
if: steps.check_notebooks.outputs.has_affected_notebooks == 'true'
run: |
notebooks=$(echo '${{ steps.changed-files.outputs.all_changed_files }}' | tr ' ' '\n' | grep -E '^(docs/docs|examples)/.*\.ipynb$' || true)
if [ -n "$notebooks" ]; then
cd ./langgraph
for notebook in $notebooks; do
absolute_path="$GITHUB_WORKSPACE/$notebook"
yarn notebook_validate "$absolute_path"
done
else
echo "No notebooks to validate."
fi
Loading

0 comments on commit 2a4dbe7

Please sign in to comment.