Skip to content

Commit e94de77

Browse files
authored
Merge pull request #21 from picoded/eugene/jsonb-support
postgres jsonb support
2 parents 3083452 + 077f4c6 commit e94de77

39 files changed

Lines changed: 2348 additions & 138 deletions
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Cockroach DB v21 Support Test
2+
on:
3+
push:
4+
branches: [ master, eugene/* ]
5+
pull_request:
6+
branches: [ master ]
7+
jobs:
8+
unit_test:
9+
runs-on: ubuntu-latest
10+
11+
# Because github services, does not allow overwriting "CMD" / "ENTRYPOINT" commands
12+
# so we are gonna to run the docker containers via the bash commandline
13+
# services:
14+
# postgres:
15+
# image: cockroachdb/cockroach:v21.1.12
16+
# env:
17+
# POSTGRES_DATABASE: javacommons
18+
# POSTGRES_USER: javacommons
19+
# POSTGRES_PASSWORD: javacommons
20+
# ports:
21+
# - 26257:26257
22+
# options: --health-cmd="curl http://localhost:8080/health?ready=1" --health-interval=10s --health-timeout=5s --health-retries=3
23+
24+
steps:
25+
- uses: actions/checkout@v1
26+
- name: Init submodules
27+
run: ./git-init-submodules.sh
28+
- name: Set up JDK 1.8
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 1.8
32+
- name: Cache Gradle packages
33+
uses: actions/cache@v2
34+
with:
35+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/build.gradle') }}
36+
path: |
37+
~/.gradle/caches
38+
~/.gradle/wrapper
39+
- name: Setup cockroachDB
40+
run: |
41+
sudo docker run -d --name=roach1 --hostname=roach1 -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v21.2.0 start-single-node --insecure && \
42+
sleep 5s
43+
- name: Setup initial cockroach DB
44+
run: |
45+
sudo docker exec roach1 cockroach sql --insecure -e "CREATE DATABASE IF NOT EXISTS javacommons" && \
46+
sudo docker exec roach1 cockroach sql --insecure -e "CREATE USER IF NOT EXISTS javacommons" && \
47+
sudo docker exec roach1 cockroach sql --insecure -e "GRANT ALL ON DATABASE javacommons TO javacommons"
48+
- name: Test basic cockroach DB connection
49+
run: |
50+
sudo apt-get update && \
51+
sudo apt-get install postgresql-client && \
52+
psql -p 26257 -h 127.0.0.1 --username=javacommons --no-password -c "SHOW DATABASES"
53+
- name: Setup gradle binaries
54+
run: ./gradlew
55+
- name: Pull dependencies libs, and perform initial compile
56+
run: ./gradlew src
57+
- name: Run unit tests
58+
run: ./gradlew test -Ptest_postgres
59+
- name: Run jacocoTestReport
60+
run: ./gradlew jacocoTestReport
61+
- name: Archive code coverage results
62+
uses: actions/upload-artifact@v2
63+
if: always()
64+
with:
65+
name: test-result-report
66+
path: |
67+
build/reports/**/*
68+
build/test-results/**/*
69+
build/jacoco/**/*
70+
- name: Upload code coverage to codecov
71+
uses: codecov/codecov-action@v2
72+
if: always()
73+
with:
74+
# flags: gradle-build # optional
75+
# directory: build/jacoco/
76+
verbose: true # optional (default = false)
77+
fail_ci_if_error: false

.github/workflows/gradle-build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,27 @@ jobs:
2828
run: ./gradlew src
2929
- name: Run unit tests
3030
run: ./gradlew test
31+
- name: Run jacocoTestReport
32+
run: ./gradlew jacocoTestReport
3133
- name: Run the build
3234
run: ./gradlew build
3335
- name: Archive code coverage results
3436
uses: actions/upload-artifact@v2
37+
if: always()
3538
with:
36-
name: code-coverage-report
39+
name: test-result-report
3740
path: |
3841
build/reports/**/*
3942
build/test-results/**/*
4043
build/jacoco/**/*
44+
- name: Upload code coverage to codecov
45+
uses: codecov/codecov-action@v2
46+
if: always()
47+
with:
48+
# flags: gradle-build # optional
49+
# directory: build/jacoco/
50+
verbose: true # optional (default = false)
51+
fail_ci_if_error: false
4152
- name: Archive binary files
4253
uses: actions/upload-artifact@v2
4354
with:

.github/workflows/local-sqlite.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Local Sqlite Support Test
2+
on:
3+
push:
4+
branches: [ master, eugene/* ]
5+
pull_request:
6+
branches: [ master ]
7+
jobs:
8+
unit_test:
9+
runs-on: ubuntu-latest
10+
11+
# Because github services, does not allow overwriting "CMD" / "ENTRYPOINT" commands
12+
# so we are gonna to run the docker containers via the bash commandline
13+
# services:
14+
# postgres:
15+
# image: cockroachdb/cockroach:v21.1.12
16+
# env:
17+
# POSTGRES_DATABASE: javacommons
18+
# POSTGRES_USER: javacommons
19+
# POSTGRES_PASSWORD: javacommons
20+
# ports:
21+
# - 26257:26257
22+
# options: --health-cmd="curl http://localhost:8080/health?ready=1" --health-interval=10s --health-timeout=5s --health-retries=3
23+
24+
steps:
25+
- uses: actions/checkout@v1
26+
- name: Init submodules
27+
run: ./git-init-submodules.sh
28+
- name: Set up JDK 1.8
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 1.8
32+
- name: Cache Gradle packages
33+
uses: actions/cache@v2
34+
with:
35+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/build.gradle') }}
36+
path: |
37+
~/.gradle/caches
38+
~/.gradle/wrapper
39+
- name: Setup gradle binaries
40+
run: ./gradlew
41+
- name: Pull dependencies libs, and perform initial compile
42+
run: ./gradlew src
43+
- name: Run unit tests
44+
run: ./gradlew test -Ptest_sqlite
45+
- name: Run jacocoTestReport
46+
run: ./gradlew jacocoTestReport
47+
- name: Archive code coverage results
48+
uses: actions/upload-artifact@v2
49+
if: always()
50+
with:
51+
name: test-result-report
52+
path: |
53+
build/reports/**/*
54+
build/test-results/**/*
55+
build/jacoco/**/*
56+
- name: Upload code coverage to codecov
57+
uses: codecov/codecov-action@v2
58+
if: always()
59+
with:
60+
# flags: gradle-build # optional
61+
# directory: build/jacoco/
62+
verbose: true # optional (default = false)
63+
fail_ci_if_error: false

.github/workflows/mysql-5-7.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66
branches: [ master ]
77
jobs:
8-
build:
8+
unit_test:
99
runs-on: ubuntu-latest
1010

1111
services:
@@ -41,11 +41,22 @@ jobs:
4141
run: ./gradlew src
4242
- name: Run unit tests
4343
run: ./gradlew test -Ptest_mysql
44+
- name: Run jacocoTestReport
45+
run: ./gradlew jacocoTestReport
4446
- name: Archive code coverage results
4547
uses: actions/upload-artifact@v2
48+
if: always()
4649
with:
47-
name: code-coverage-report
50+
name: test-result-report
4851
path: |
4952
build/reports/**/*
5053
build/test-results/**/*
5154
build/jacoco/**/*
55+
- name: Upload code coverage to codecov
56+
uses: codecov/codecov-action@v2
57+
if: always()
58+
with:
59+
# flags: gradle-build # optional
60+
# directory: build/jacoco/
61+
verbose: true # optional (default = false)
62+
fail_ci_if_error: false

.github/workflows/mysql-8.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66
branches: [ master ]
77
jobs:
8-
build:
8+
unit_test:
99
runs-on: ubuntu-latest
1010

1111
services:
@@ -41,11 +41,22 @@ jobs:
4141
run: ./gradlew src
4242
- name: Run unit tests
4343
run: ./gradlew test -Ptest_mysql
44+
- name: Run jacocoTestReport
45+
run: ./gradlew jacocoTestReport
4446
- name: Archive code coverage results
4547
uses: actions/upload-artifact@v2
48+
if: always()
4649
with:
47-
name: code-coverage-report
50+
name: test-result-report
4851
path: |
4952
build/reports/**/*
5053
build/test-results/**/*
5154
build/jacoco/**/*
55+
- name: Upload code coverage to codecov
56+
uses: codecov/codecov-action@v2
57+
if: always()
58+
with:
59+
# flags: gradle-build # optional
60+
# directory: build/jacoco/
61+
verbose: true # optional (default = false)
62+
fail_ci_if_error: false
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: (perf) Cockroach DB v21 Support Test
2+
on:
3+
# -------------------------------------------------------------------------------------------------------------------------------
4+
# Disabling perf test to ensure build time is < 4m
5+
# The "perf" branch is a placeholder (it does not exists now)
6+
# see: https://github.com/picoded/JavaCommons-dstack/blob/7f321d8bed9ea8445018ba5315084475dc81c786/notes/perf-test-notes.md
7+
# -------------------------------------------------------------------------------------------------------------------------------
8+
# push:
9+
# branches: [ master, eugene/* ]
10+
# pull_request:
11+
# branches: [ master ]
12+
push:
13+
branches: [ perf ]
14+
# pull_request:
15+
# branches: [ perf ]
16+
jobs:
17+
unit_test:
18+
runs-on: ubuntu-latest
19+
20+
# Because github services, does not allow overwriting "CMD" / "ENTRYPOINT" commands
21+
# so we are gonna to run the docker containers via the bash commandline
22+
# services:
23+
# postgres:
24+
# image: cockroachdb/cockroach:v21.1.12
25+
# env:
26+
# POSTGRES_DATABASE: javacommons
27+
# POSTGRES_USER: javacommons
28+
# POSTGRES_PASSWORD: javacommons
29+
# ports:
30+
# - 26257:26257
31+
# options: --health-cmd="curl http://localhost:8080/health?ready=1" --health-interval=10s --health-timeout=5s --health-retries=3
32+
33+
steps:
34+
- uses: actions/checkout@v1
35+
- name: Init submodules
36+
run: ./git-init-submodules.sh
37+
- name: Set up JDK 1.8
38+
uses: actions/setup-java@v1
39+
with:
40+
java-version: 1.8
41+
- name: Cache Gradle packages
42+
uses: actions/cache@v2
43+
with:
44+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/build.gradle') }}
45+
path: |
46+
~/.gradle/caches
47+
~/.gradle/wrapper
48+
- name: Setup cockroachDB
49+
run: |
50+
sudo docker run -d --name=roach1 --hostname=roach1 -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v21.2.0 start-single-node --insecure && \
51+
sleep 5s
52+
- name: Setup initial cockroach DB
53+
run: |
54+
sudo docker exec roach1 cockroach sql --insecure -e "CREATE DATABASE IF NOT EXISTS javacommons" && \
55+
sudo docker exec roach1 cockroach sql --insecure -e "CREATE USER IF NOT EXISTS javacommons" && \
56+
sudo docker exec roach1 cockroach sql --insecure -e "GRANT ALL ON DATABASE javacommons TO javacommons"
57+
- name: Test basic cockroach DB connection
58+
run: |
59+
sudo apt-get update && \
60+
sudo apt-get install postgresql-client && \
61+
psql -p 26257 -h 127.0.0.1 --username=javacommons --no-password -c "SHOW DATABASES"
62+
- name: Setup gradle binaries
63+
run: ./gradlew
64+
- name: Pull dependencies libs, and perform initial compile
65+
run: ./gradlew src
66+
# Running the various perf tests
67+
- name: Run perf unit tests
68+
run: |
69+
./gradle-test-classpath.sh picoded.dstack.jsql.postgres.JSql_DataObjectMap_Postgres_perf
70+
- name: Run jacocoTestReport
71+
run: ./gradlew jacocoTestReport
72+
- name: Archive code coverage results
73+
uses: actions/upload-artifact@v2
74+
if: always()
75+
with:
76+
name: test-result-report
77+
path: |
78+
build/reports/**/*
79+
build/test-results/**/*
80+
build/jacoco/**/*
81+
- name: Upload code coverage to codecov
82+
uses: codecov/codecov-action@v2
83+
if: always()
84+
with:
85+
# flags: gradle-build # optional
86+
# directory: build/jacoco/
87+
verbose: true # optional (default = false)
88+
fail_ci_if_error: false

0 commit comments

Comments
 (0)