Skip to content

Commit 940d102

Browse files
authored
#21 run java and csharp snippets (#22)
1 parent b85e7bd commit 940d102

File tree

27 files changed

+448
-232
lines changed

27 files changed

+448
-232
lines changed

.github/linters/.jscpd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"threshold": 32
2+
"ignore": ["**/java/**","**/csharp/**","**/python/**"]
33
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: csharp darwin snippets
2+
3+
on: [pull_request, workflow_dispatch]
4+
5+
permissions:
6+
contents: read
7+
pull-requests: write
8+
9+
jobs:
10+
csharp-darwin-snippets:
11+
runs-on: macos-latest
12+
strategy:
13+
matrix:
14+
include:
15+
- dotnet-version: "8"
16+
17+
steps:
18+
- name: checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: ${{ matrix.dotnet-version }}
26+
27+
- name: install Senzing SDK
28+
uses: senzing-factory/github-action-install-senzing-sdk@v2
29+
with:
30+
senzingsdk-repository-path: ${{ secrets.SENZING_OSX_BETA_REPOSITORY }}
31+
32+
- name: configure local nuget repo
33+
run: |
34+
find /opt/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename
35+
sdk_package=$(find /opt/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename)
36+
mkdir -p ~/dev/nuget/packages
37+
dotnet nuget add source ~/dev/nuget/packages -n dev
38+
dotnet nuget push /opt/senzing/er/sdk/dotnet/"${sdk_package}" --source dev
39+
40+
- name: run csharp snippets
41+
env:
42+
DYLD_LIBRARY_PATH: "/opt/senzing/er/lib"
43+
SENZING_DATA_DIR: "/opt/senzing/er/data"
44+
run: |
45+
cd "${GITHUB_WORKSPACE}"/csharp/runner
46+
dotnet add SnippetRunner package Senzing.Sdk --version 4.0.0-beta
47+
dotnet run --project SnippetRunner all
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: csharp linux snippets
2+
3+
on:
4+
push:
5+
branches-ignore: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
csharp-linux-snippets:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
include:
19+
- dotnet-version: "8"
20+
21+
steps:
22+
- name: checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- uses: actions/setup-dotnet@v4
28+
with:
29+
dotnet-version: ${{ matrix.dotnet-version }}
30+
31+
- name: install Senzing runtime
32+
uses: senzing-factory/github-action-install-senzing-sdk@v2
33+
with:
34+
packages-to-install: "senzingsdk-runtime senzingsdk-setup"
35+
senzingsdk-repository-package: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_PACKAGE }}
36+
senzingsdk-repository-path: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_URL }}
37+
38+
- name: configure local nuget repo
39+
run: |
40+
sdk_package=$(grep -Rl "Senzing.Sdk" /opt/senzing/er/sdk/dotnet/ | xargs -L 1 basename)
41+
mkdir -p ~/dev/nuget/packages
42+
dotnet nuget add source ~/dev/nuget/packages -n dev
43+
dotnet nuget push /opt/senzing/er/sdk/dotnet/"${sdk_package}" --source dev
44+
45+
- name: run csharp snippets
46+
env:
47+
LD_LIBRARY_PATH: "/opt/senzing/er/lib"
48+
run: |
49+
cd "${GITHUB_WORKSPACE}"/csharp/runner
50+
dotnet add SnippetRunner package Senzing.Sdk --version 4.0.0-beta
51+
dotnet run --project SnippetRunner all
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: csharp windows snippets
2+
3+
on: [pull_request, workflow_dispatch]
4+
5+
permissions:
6+
contents: read
7+
pull-requests: write
8+
9+
jobs:
10+
csharp-windows-snippets:
11+
runs-on: windows-latest
12+
strategy:
13+
matrix:
14+
include:
15+
- dotnet-version: "8"
16+
17+
steps:
18+
- name: checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: ${{ matrix.dotnet-version }}
26+
27+
- name: install Senzing SDK
28+
uses: senzing-factory/github-action-install-senzing-sdk@v2
29+
with:
30+
senzingsdk-repository-path: ${{ secrets.SENZING_WIN_BETA_REPOSITORY }}
31+
32+
- name: configure local nuget repo
33+
run: |
34+
$Env:sdk_package = Get-ChildItem -Path "C:\Program Files\Senzing\er\sdk\dotnet\" -Recurse | Where-Object {$_.Name -match "^Senzing.SDK*"} | Select-Object -ExpandProperty Name
35+
mkdir $Env:USERPROFILE\dev\nuget\packages
36+
cd $Env:USERPROFILE\dev\nuget\packages
37+
dir
38+
dotnet nuget add source $Env:USERPROFILE\dev\nuget\packages -n senzing
39+
dotnet nuget push "C:\Program Files\Senzing\er\sdk\dotnet\${Env:sdk_package}" --source senzing
40+
dotnet nuget list source
41+
42+
- name: Add to "Path" environment variable
43+
run: |
44+
Add-Content $env:GITHUB_PATH "C:\Program Files\Senzing\er\lib"
45+
46+
- name: run csharp snippets
47+
run: |
48+
echo $Env:Path
49+
cd ${Env:GITHUB_WORKSPACE}/csharp/runner
50+
dotnet run --project SnippetRunner all
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: java darwin snippets
2+
3+
on: [pull_request, workflow_dispatch]
4+
5+
permissions:
6+
contents: read
7+
pull-requests: write
8+
9+
jobs:
10+
java-darwin-snippets:
11+
runs-on: macos-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
java-version: ["17", "21"]
16+
java-distribution: ["temurin"]
17+
18+
steps:
19+
- name: checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- uses: actions/setup-java@v4
25+
with:
26+
distribution: ${{ matrix.java-distribution }}
27+
java-version: ${{ matrix.java-version }}
28+
29+
- name: install Senzing SDK
30+
uses: senzing-factory/github-action-install-senzing-sdk@v2
31+
with:
32+
senzingsdk-repository-path: ${{ secrets.SENZING_OSX_BETA_REPOSITORY }}
33+
34+
- name: build with Maven
35+
env:
36+
SENZING_DIR: "/opt/senzing/er"
37+
run: |
38+
cd "${GITHUB_WORKSPACE}"/java
39+
mvn clean install
40+
41+
- name: run java snippets
42+
env:
43+
DYLD_LIBRARY_PATH: "/opt/senzing/er/lib"
44+
run: |
45+
cd "${GITHUB_WORKSPACE}"/java
46+
java -jar target/sz-sdk-snippets.jar all
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: java linux snippets
2+
3+
on:
4+
push:
5+
branches-ignore: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
java-linux-snippets:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
java-version: ["17", "21"]
20+
java-distribution: ["temurin"]
21+
22+
steps:
23+
- name: checkout repository
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- uses: actions/setup-java@v4
29+
with:
30+
java-version: ${{ matrix.java-version }}
31+
distribution: ${{ matrix.java-distribution }}
32+
33+
- name: install Senzing runtime
34+
uses: senzing-factory/github-action-install-senzing-sdk@v2
35+
with:
36+
packages-to-install: "senzingsdk-runtime senzingsdk-setup"
37+
senzingsdk-repository-package: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_PACKAGE }}
38+
senzingsdk-repository-path: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_URL }}
39+
40+
- name: build with Maven
41+
env:
42+
SENZING_DIR: "/opt/senzing/er"
43+
run: |
44+
cd "${GITHUB_WORKSPACE}"/java
45+
mvn clean package
46+
47+
- name: run java snippets
48+
env:
49+
LD_LIBRARY_PATH: "/opt/senzing/er/lib:${LD_LIBRARY_PATH}"
50+
run: |
51+
cd "${GITHUB_WORKSPACE}"/java
52+
java -jar target/sz-sdk-snippets.jar all
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: java windows snippets
2+
3+
on: [pull_request, workflow_dispatch]
4+
5+
permissions:
6+
contents: read
7+
pull-requests: write
8+
9+
jobs:
10+
java-windows-snippets:
11+
runs-on: windows-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
java-version: ["17", "21"]
16+
java-distribution: ["temurin"]
17+
18+
steps:
19+
- name: checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- uses: actions/setup-java@v4
25+
with:
26+
java-version: ${{ matrix.java-version }}
27+
distribution: ${{ matrix.java-distribution }}
28+
29+
- name: install Senzing SDK
30+
uses: senzing-factory/github-action-install-senzing-sdk@v2
31+
with:
32+
senzingsdk-repository-path: ${{ secrets.SENZING_WIN_BETA_REPOSITORY }}
33+
34+
- name: build with Maven
35+
env:
36+
SENZING_DIR: 'C:\Program Files\Senzing\er'
37+
run: |
38+
cd "${Env:GITHUB_WORKSPACE}/java"
39+
mvn clean install
40+
41+
- name: Add to "Path" environment variable
42+
run: |
43+
Add-Content $env:GITHUB_PATH "C:\Program Files\Senzing\er\lib"
44+
45+
- name: run java snippets
46+
run: |
47+
cd "${Env:GITHUB_WORKSPACE}/java"
48+
java -jar target/sz-sdk-snippets.jar all

0 commit comments

Comments
 (0)