Skip to content

ci-pydgraph-tests

ci-pydgraph-tests #573

name: ci-pydgraph-tests
on:
push:
branches:
- master
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- master
schedule:
- cron: "1 0 * * *" # run workflow daily
jobs:
build:
name: pydgraph-tests
runs-on: ubuntu-20.04
steps:
- name: Checkout Dgraph repo # needed for acl tests
uses: actions/checkout@v4
with:
path: dgraph
repository: dgraph-io/dgraph
ref: main
- name: Checkout pydgraph repo
uses: actions/checkout@v4
with:
path: pydgraph
repository: dgraph-io/pydgraph
ref: ${{ github.ref }}
- name: Get Go Version
run: |
#!/bin/bash
cd dgraph
GOVERSION=$({ [ -f .go-version ] && cat .go-version; })
echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOVERSION }}
- name: Build dgraph binary
run: cd dgraph && make docker-image # also builds dgraph binary
- name: Move dgraph binary to gopath
run: cd dgraph && mv dgraph/dgraph ~/go/bin/dgraph
- name: Get Python Version
run: |
#!/bin/bash
cd pydgraph
PYTHON_VERSION=$({ [ -f .python-version ] && cat .python-version; })
echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
cd pydgraph
python -m pip install --upgrade pip
python -m pip install .[dev]
- name: Run tests
run: cd pydgraph && DGRAPH_IMAGE_TAG=local bash scripts/local-test.sh