Skip to content

ci-dgraph4j-tests

ci-dgraph4j-tests #531

name: ci-dgraph4j-tests
on:
push:
branches:
- master
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- master
schedule:
- cron: "0 0 * * *" # run workflow daily
jobs:
build:
name: dgraph4j-tests
runs-on: ubuntu-20.04
steps:
- name: Checkout Dgraph repo # use latest dgraph build
uses: actions/checkout@v4
with:
path: dgraph
repository: dgraph-io/dgraph
ref: main
- name: Checkout dgraph4j repo
uses: actions/checkout@v4
with:
path: dgraph4j
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: microsoft
java-version-file: dgraph4j/.java-version
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: current
- 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 # builds docker image with local tag
- name: Spin up local dgraph cluster
run: cd dgraph4j && docker compose -f docker-compose.test.yml up -d
- name: Run tests
run: cd dgraph4j && gradle build
- name: Tear down cluster
run: cd dgraph4j && docker compose -f docker-compose.test.yml down