Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): add CI to dgraph4j repo #191

Merged
merged 10 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/ci-dgraph4j-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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@v3
with:
path: dgraph
repository: dgraph-io/dgraph
ref: main
- name: Checkout dgraph4j repo
uses: actions/checkout@v3
with:
path: dgraph4j
repository: dgraph-io/dgraph4j
ref: ${{ github.ref }}
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: microsoft
java-version-file: dgraph4j/.java-version
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- 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@v3
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 && ./gradlew build
- name: Tear down cluster
run: cd dgraph4j && docker compose -f docker-compose.test.yml down
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
26 changes: 5 additions & 21 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version: "3.5"
services:
alpha1:
image: dgraph/dgraph:v21.12.0
image: dgraph/dgraph:local
container_name: alpha1
working_dir: /data/alpha1
labels:
Expand All @@ -19,12 +19,8 @@ services:
command: dgraph alpha -o 100 --my=alpha1:7180 --zero=zero1:5180 --logtostderr
-v=2 --raft "idx=1; group=1" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;"
--acl "secret-file=/secret/hmac; access-ttl=3s"
deploy:
resources:
limits:
memory: 32G
alpha2:
image: dgraph/dgraph:v21.12.0
image: dgraph/dgraph:local
container_name: alpha2
working_dir: /data/alpha2
labels:
Expand All @@ -40,12 +36,8 @@ services:
command: dgraph alpha -o 102 --my=alpha2:7182 --zero=zero1:5180 --logtostderr
-v=2 --raft "idx=2; group=1" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;"
--acl "secret-file=/secret/hmac; access-ttl=3s"
deploy:
resources:
limits:
memory: 32G
alpha3:
image: dgraph/dgraph:v21.12.0
image: dgraph/dgraph:local
container_name: alpha3
working_dir: /data/alpha3
labels:
Expand All @@ -61,12 +53,8 @@ services:
command: dgraph alpha -o 103 --my=alpha3:7183 --zero=zero1:5180 --logtostderr
-v=2 --raft "idx=3; group=1" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;"
--acl "secret-file=/secret/hmac; access-ttl=3s"
deploy:
resources:
limits:
memory: 32G
zero1:
image: dgraph/dgraph:v21.12.0
image: dgraph/dgraph:local
container_name: zero1
working_dir: /data/zero1
labels:
Expand All @@ -76,8 +64,4 @@ services:
- 6180:6180
command: dgraph zero -o 100 --raft='idx=1' --my=zero1:5180 --replicas=3
--logtostderr -v=2 --bindall
deploy:
resources:
limits:
memory: 32G
volumes: {}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Nov 01 15:13:53 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
Loading