| name: HG-Python-Client CI |
| |
| on: |
| push: |
| branches: |
| - 'main' |
| - 'release-*' |
| pull_request: |
| |
| jobs: |
| build: |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| matrix: |
| python-version: ["3.10", "3.11", "3.12"] |
| |
| steps: |
| # TODO: upgrade to HugeGraph 1.5.0 (need to update the test cases) |
| - name: Prepare HugeGraph Server Environment |
| run: | |
| docker run -d --name=graph -p 8080:8080 -e PASSWORD=admin hugegraph/hugegraph:1.3.0 |
| sleep 10 |
| |
| - uses: actions/checkout@v4 |
| |
| - name: Set up Python ${{ matrix.python-version }} |
| uses: actions/setup-python@v5 |
| with: |
| python-version: ${{ matrix.python-version }} |
| |
| - name: Install uv |
| run: | |
| curl -LsSf https://astral.sh/uv/install.sh | sh |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH |
| |
| - name: Cache dependencies |
| id: cache-deps |
| uses: actions/cache@v4 |
| with: |
| path: | |
| ~/.cache/uv |
| key: ${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} |
| restore-keys: | |
| ${{ runner.os }}-uv-${{ matrix.python-version }}- |
| |
| - name: Install dependencies with uv sync |
| run: | |
| uv sync --extra python-client --extra dev |
| |
| - name: Test example |
| run: | |
| ls -al |
| export PYTHONPATH=$(pwd)/hugegraph-python-client/src && echo ${PYTHONPATH} |
| uv run python hugegraph-python-client/src/pyhugegraph/example/hugegraph_example.py |
| |
| - name: Test with pytest |
| run: | |
| uv run pytest |
| working-directory: hugegraph-python-client |