name: Documentation Code Testing on: push: branches: - main paths: - docs/** - .github/workflows/docs_test.yml pull_request: paths: - docs/** - .github/workflows/docs_test.yml # Allows you to run this workflow manually from the Actions tab workflow_dispatch: env: # Disable full debug symbol generation to speed up CI build and keep memory down # "1" means line tables only, which is useful for panic tracebacks. RUSTFLAGS: "-C debuginfo=1 -C target-cpu=native -C target-feature=+f16c,+avx2,+fma" RUST_BACKTRACE: "1" jobs: test-python: name: Test doc python code runs-on: "ubuntu-latest" steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: 3.11 cache: "pip" cache-dependency-path: "docs/test/requirements.txt" - name: Build Python working-directory: docs/test run: python -m pip install -r requirements.txt - name: Create test files run: | cd docs/test python md_testing.py - name: Test run: | cd docs/test/python for d in *; do cd "$d"; echo "$d".py; python "$d".py; cd ..; done test-node: name: Test doc nodejs code runs-on: "ubuntu-latest" steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 lfs: true - name: Set up Node uses: actions/setup-node@v4 with: node-version: 20 - name: Install dependecies needed for ubuntu run: | sudo apt install -y protobuf-compiler libssl-dev - name: Rust cache uses: swatinem/rust-cache@v2 - name: Install node dependencies run: | cd node npm ci npm run build cd ../docs npm install - name: Run doc test run: | cd docs npm t - name: Install dependencies for generated code run: | cd docs/test npm install - name: Install LanceDB run: | cd docs/test/node_modules/vectordb npm ci npm run build-release npm run tsc - name: Create test files run: | cd docs/test node md_testing.js - name: Test env: LANCEDB_URI: ${{ secrets.LANCEDB_URI }} LANCEDB_DEV_API_KEY: ${{ secrets.LANCEDB_DEV_API_KEY }} run: | cd docs/test/node for d in *; do cd "$d"; echo "$d".js; node "$d".js; cd ..; done