docs: add AI coding agent skills and cross-reference throughout documentation #881
Workflow file for this run
This file contains hidden or 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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - 'v*' # Match tags starting with v, e.g., v1.0.0 | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| runs-on: Linux | |
| env: | |
| NVIDIA_DRIVER_CAPABILITIES: all | |
| NVIDIA_VISIBLE_DEVICES: all | |
| NVIDIA_DISABLE_REQUIRE: 1 | |
| container: &container_template | |
| image: 192.168.3.13:5000/dexsdk:ubuntu22.04-cuda12.8.0-h5ffmpeg-v3 | |
| volumes: | |
| - "/cache:/cache" | |
| - "/usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d" | |
| - "/usr/share/vulkan/implicit_layer.d:/usr/share/vulkan/implicit_layer.d" | |
| - "/usr/share/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d" | |
| - "/tmp/.X11-unix:/tmp/.X11-unix" | |
| - "/dev/shm/shared:/dev/shm/shared" | |
| options: --memory 100g --gpus device=1 --shm-size 53687091200 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Code Style check | |
| run: | | |
| echo "Workspace: ${GITHUB_WORKSPACE}" | |
| ls | |
| pip install black==24.3.0 | |
| black --check --diff --color ./ | |
| if [ $? -ne 0 ]; then | |
| echo "Code style check failed, please run [black ./] before commit!" | |
| exit 1 | |
| fi | |
| build: | |
| needs: lint | |
| runs-on: Linux | |
| env: | |
| NVIDIA_DRIVER_CAPABILITIES: all | |
| NVIDIA_VISIBLE_DEVICES: all | |
| NVIDIA_DISABLE_REQUIRE: 1 | |
| DOCS_MAX_VERSIONS: "4" # Max number of release versions to keep | |
| container: *container_template | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache Python dependencies | |
| id: cache-pip | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-docs-${{ hashFiles('docs/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-docs- | |
| - name: Restore previous docs output | |
| if: github.event_name == 'push' | |
| uses: actions/cache@v4 | |
| with: | |
| path: docs/build/html | |
| key: docs-output-${{ github.repository }}-${{ github.ref_name }} | |
| restore-keys: | | |
| docs-output-${{ github.repository }}-${{ github.ref_name }}- | |
| docs-output-${{ github.repository }}- | |
| - name: Build docs | |
| shell: bash | |
| run: | | |
| pip install -e . --extra-index-url http://pyp.open3dv.site:2345/simple/ --trusted-host pyp.open3dv.site | |
| pip install -r docs/requirements.txt | |
| cd ${GITHUB_WORKSPACE}/docs | |
| pip uninstall pymeshlab -y | |
| pip install pymeshlab==2023.12.post3 | |
| if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| VERSION="${GITHUB_REF_NAME}" | |
| echo "Building docs for release tag ${VERSION}..." | |
| # Build only this version into its own subdirectory | |
| sphinx-build source build/html/${VERSION} | |
| cd build/html | |
| # Prune old release versions beyond the window | |
| mapfile -t TAG_DIRS < <(ls -d v*/ 2>/dev/null | sort -V) | |
| while [[ ${#TAG_DIRS[@]} -gt ${DOCS_MAX_VERSIONS} ]]; do | |
| echo "Pruning old version: ${TAG_DIRS[0]}" | |
| rm -rf "${TAG_DIRS[0]}" | |
| TAG_DIRS=("${TAG_DIRS[@]:1}") | |
| done | |
| # Generate versions.json and root index.html | |
| python3 ${GITHUB_WORKSPACE}/docs/scripts/generate_versions_json.py \ | |
| --build-dir . | |
| else | |
| echo "Building dev docs for main branch..." | |
| # Build only main/ — don't touch existing version directories | |
| rm -rf build/html/main | |
| sphinx-build source build/html/main | |
| cd build/html | |
| # Generate versions.json and root index.html | |
| python3 ${GITHUB_WORKSPACE}/docs/scripts/generate_versions_json.py \ | |
| --build-dir . | |
| fi | |
| - name: Upload docs artifact | |
| if: github.event_name == 'push' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ${{ github.workspace }}/docs/build/html | |
| test: | |
| if: github.event_name == 'pull_request' | |
| needs: lint | |
| runs-on: Linux | |
| env: | |
| NVIDIA_DRIVER_CAPABILITIES: all | |
| NVIDIA_VISIBLE_DEVICES: all | |
| NVIDIA_DISABLE_REQUIRE: 1 | |
| container: *container_template | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run tests | |
| run: | | |
| pip install -e .[lerobot] --extra-index-url http://pyp.open3dv.site:2345/simple/ --trusted-host pyp.open3dv.site | |
| echo "Unit test Start" | |
| export HF_ENDPOINT=https://hf-mirror.com | |
| pip uninstall pymeshlab -y | |
| pip install pymeshlab==2023.12.post3 | |
| pip install numpy==1.26.4 | |
| pytest tests | |
| publish: | |
| if: github.event_name == 'push' | |
| needs: build | |
| runs-on: Linux | |
| permissions: | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Download docs artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: github-pages | |
| - name: Deploy GitHub Pages | |
| uses: actions/deploy-pages@v4 | |
| # release: | |
| # if: startsWith(github.ref, 'refs/tags/v') | |
| # runs-on: Linux | |
| # permissions: | |
| # contents: write | |
| # id-token: write # PyPI Trusted Publishing | |
| # container: *container_template | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # fetch-depth: 0 | |
| # - name: (Release) Install build tools | |
| # run: | | |
| # python -m pip install --upgrade pip | |
| # pip install build | |
| # - name: (Release) Build sdist and wheel | |
| # run: | | |
| # python -m build --wheel | |
| # # - name: (Release) Create GitHub Release (draft) | |
| # # uses: softprops/action-gh-release@v2 | |
| # # with: | |
| # # draft: true | |
| # # generate_release_notes: true | |
| # # files: | | |
| # # dist/* | |
| # # env: | |
| # # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # - name: (Release) Publish to PyPI | |
| # uses: pypa/gh-action-pypi-publish@release/v1 | |
| # with: | |
| # password: ${{ secrets.PYPI_API_TOKEN }} |