Skip to content

Commit d11170e

Browse files
adding initial CI by using the examples
1 parent b60ad9a commit d11170e

File tree

3 files changed

+46
-12
lines changed

3 files changed

+46
-12
lines changed

.github/workflows/github_actions.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,46 @@
11
name: TileDB-Cloud-Java
22

33
on:
4+
workflow_dispatch:
45
push:
56
tags:
67
- '*'
8+
branches:
9+
- master
10+
- test-*
11+
pull_request:
712

813
jobs:
14+
Examples:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: checkout
18+
uses: actions/checkout@v3
19+
20+
- run: |
21+
unset SYSTEM
22+
./gradlew assemble;
23+
shell: bash
24+
name: assemble
25+
26+
- name: Run examples
27+
env:
28+
API_TOKEN: ${{ secrets.API_TOKEN }}
29+
run: |
30+
cd build/libs
31+
rm *javadoc* *sources* *default*
32+
p=$(readlink -f *.jar)
33+
cd ../../src/main/java/examples
34+
javac -cp $p *.java
35+
for x in $(ls -1 *.java | sed 's/.java//');
36+
do
37+
echo $x;
38+
class_name=examples.$x;
39+
java -cp $p $class_name;
40+
done
941
Release:
1042
if: startsWith(github.ref, 'refs/tags/')
43+
needs: [Examples]
1144
name: Create-Release
1245
runs-on: ubuntu-latest
1346
steps:

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ apply plugin: 'java'
2727
apply plugin: 'com.diffplug.spotless'
2828

2929
group 'io.tiledb'
30-
version = '0.1.1-SNAPSHOT'
30+
version = '0.2.1-SNAPSHOT'
3131

3232
repositories {
3333
mavenCentral()

src/main/java/examples/Examples.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import io.tiledb.cloud.rest_api.api.GroupsApi;
77
import io.tiledb.cloud.rest_api.api.ArrayApi;
88
import io.tiledb.cloud.rest_api.model.*;
9+
import jdk.swing.interop.SwingInterOpUtils;
910
import org.apache.arrow.vector.ValueVector;
1011

1112
import java.math.BigDecimal;
@@ -24,7 +25,7 @@ public static void main(String[] args) {
2425
TileDBClient tileDBClient = new TileDBClient(
2526
new TileDBLogin(null,
2627
null,
27-
"<TILEDB_API_TOKEN>",
28+
System.getenv("API_TOKEN"),
2829
true,
2930
true,
3031
true));
@@ -35,18 +36,18 @@ public static void main(String[] args) {
3536

3637

3738
// Uncomment to run whichever example you want
38-
// runGenericUDF(tileDBClient);
39-
// runArrayUDF(tileDBClient);
40-
// runMultiArrayUDF(tileDBClient);
41-
// getArraySchema(tileDBClient);
39+
runGenericUDF(tileDBClient);
40+
runArrayUDF(tileDBClient);
41+
runMultiArrayUDF(tileDBClient);
42+
getArraySchema(tileDBClient);
4243
// createArray(tileDBClient);
4344
// registerArray(tileDBClient);
44-
// listArrays(tileDBClient);
45-
// listGroups(tileDBClient);
45+
listArrays(tileDBClient);
46+
listGroups(tileDBClient);
4647
// deleteArray(tileDBClient);
4748
// deregisterArray(tileDBClient);
48-
// runSQL(tileDBClient);
49-
// runSQLArrow(tileDBClient);
49+
runSQL(tileDBClient);
50+
runSQLArrow(tileDBClient);
5051

5152
}
5253

@@ -205,7 +206,7 @@ private static void listGroups(TileDBClient tileDBClient)
205206
Integer page = null; // Integer | pagination offset
206207
Integer perPage = null; // Integer | pagination limit
207208
String search = null; // String | search string that will look at name, namespace or description fields
208-
String namespace = "<TILEDB_NAMESPACE>"; // String | namespace
209+
String namespace = "TileDB-Inc"; // String | namespace
209210
String orderby = null; // String | sort by which field valid values include last_accessed, size, name
210211
String permissions = null; // String | permissions valid values include read, read_write, write, admin
211212
List<String> tag = null; // List<String> | tag to search for, more than one can be included
@@ -228,7 +229,7 @@ private static void listGroups(TileDBClient tileDBClient)
228229

229230
private static void listArrays(TileDBClient tileDBClient)
230231
{
231-
String namespace = "<TILEDB_NAMESPACE>"; // String | namespace array is in (an organization name or user's username)
232+
String namespace = "dstara"; // String | namespace array is in (an organization name or user's username)
232233
ArrayApi apiInstance = new ArrayApi(tileDBClient.getApiClient());
233234

234235
try {

0 commit comments

Comments
 (0)