docs: update examples docs (#1488) #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=haswell -C target-feature=+f16c,+avx2,+fma" | |
RUST_BACKTRACE: "1" | |
jobs: | |
test-python: | |
name: Test doc python code | |
runs-on: "warp-ubuntu-latest-x64-4x" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Print CPU capabilities | |
run: cat /proc/cpuinfo | |
- name: Install dependecies needed for ubuntu | |
run: | | |
sudo apt install -y protobuf-compiler libssl-dev | |
rustup update && rustup default | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
cache: "pip" | |
cache-dependency-path: "docs/test/requirements.txt" | |
- name: Rust cache | |
uses: swatinem/rust-cache@v2 | |
- 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: "warp-ubuntu-latest-x64-4x" | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Print CPU capabilities | |
run: cat /proc/cpuinfo | |
- 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 | |
rustup update && rustup default | |
- name: Rust cache | |
uses: swatinem/rust-cache@v2 | |
- name: Install node dependencies | |
run: | | |
sudo swapoff -a | |
sudo fallocate -l 8G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo swapon --show | |
cd node | |
npm ci | |
npm run build-release | |
cd ../docs | |
npm install | |
- name: Test | |
env: | |
LANCEDB_URI: ${{ secrets.LANCEDB_URI }} | |
LANCEDB_DEV_API_KEY: ${{ secrets.LANCEDB_DEV_API_KEY }} | |
run: | | |
cd docs | |
npm t |