Skip to content

Commit

Permalink
#282 test database - 1
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Feb 28, 2025
1 parent 0c98355 commit f75d380
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/workflows/go-test-linux-mssql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Go test linux - mssql

on: [push]

env:
SENZING_LOG_LEVEL: TRACE
SENZING_TOOLS_DATABASE_URL: "mssql://sa:Passw0rd@localhost:1433/G2"

permissions:
contents: read

jobs:
go-test-linux:
name: "Go test with Senzing: ${{ matrix.senzingsdk-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }} - mssql"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
os: [ubuntu-latest]
senzingsdk-version: [staging-v4]

services:
mssql:
# https://mcr.microsoft.com/en-us/artifact/mar/mssql/server
env:
ACCEPT_EULA: Y
MSSQL_PID: Developer
MSSQL_SA_PASSWORD: Passw0rd
image: mcr.microsoft.com/mssql/server
ports:
- 1433:1433

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Copy /opt/senzing/er/resources/ files
run: sudo cp --verbose --recursive rootfs/* /

- name: Install Senzing SDK
uses: senzing-factory/github-action-install-senzing-sdk@v3
with:
packages-to-install: "senzingsdk-runtime senzingsdk-setup"
senzingsdk-repository-package: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_PACKAGE }}
senzingsdk-repository-path: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_URL }}

- name: Run go test
run: |
export SENZING_PATH="/opt/senzing"
export LD_LIBRARY_PATH="${SENZING_PATH}/er/lib:${SENZING_PATH}/er/lib/macos"
go test -json -v -p 1 ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
65 changes: 65 additions & 0 deletions .github/workflows/go-test-linux-mysql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Go test linux - mysql

on: [push]

env:
SENZING_LOG_LEVEL: TRACE
SENZING_TOOLS_DATABASE_URL: "mysql://mysql:mysql@localhost:3306/G2"

permissions:
contents: read

jobs:
go-test-linux:
name: "Go test with Senzing: ${{ matrix.senzingsdk-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }} - mysql"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
os: [ubuntu-latest]
senzingsdk-version: [staging-v4]

services:
mysql:
# https://hub.docker.com/r/bitnami/mysql
env:
MYSQL_DATABASE: G2
MYSQL_PASSWORD: mysql
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: mysql
image: bitnami/mysql
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Copy /opt/senzing/er/resources/ files
run: sudo cp --verbose --recursive rootfs/* /

- name: Install Senzing SDK
uses: senzing-factory/github-action-install-senzing-sdk@v3
with:
packages-to-install: "senzingsdk-runtime senzingsdk-setup"
senzingsdk-repository-package: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_PACKAGE }}
senzingsdk-repository-path: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_URL }}

- name: Run go test
run: |
export SENZING_PATH="/opt/senzing"
export LD_LIBRARY_PATH="${SENZING_PATH}/er/lib:${SENZING_PATH}/er/lib/macos"
go test -json -v -p 1 ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
69 changes: 69 additions & 0 deletions .github/workflows/go-test-linux-oracle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Go test linux - oracle

on: [push]

env:
SENZING_LOG_LEVEL: TRACE
SENZING_TOOLS_DATABASE_URL: "oci://sys:Passw0rd@localhost:1521/G2"

permissions:
contents: read

jobs:
go-test-linux:
name: "Go test with Senzing: ${{ matrix.senzingsdk-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }} - oracle"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
os: [ubuntu-latest]
senzingsdk-version: [staging-v4]

services:
oracle:
# https://container-registry.oracle.com/ords/ocr/ba/database/free
env:
ORACLE_PWD: Passw0rd
image: container-registry.oracle.com/database/free
ports:
- 1521:1521

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Copy /opt/senzing/er/resources/ files
run: sudo cp --verbose --recursive rootfs/* /

- name: Install Senzing SDK
uses: senzing-factory/github-action-install-senzing-sdk@v3
with:
packages-to-install: "senzingsdk-runtime senzingsdk-setup"
senzingsdk-repository-package: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_PACKAGE }}
senzingsdk-repository-path: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_URL }}

- name: Install Oracle SDK
run: |
curl --output /tmp/instantclient-basic-linux.zip https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip
sudo mkdir -p /opt/oracle
sudo unzip -d /opt/oracle /tmp/instantclient-basic-linux.zip
sudo apt-get install libaio1t64 libaio-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/libaio.so.1
- name: Run go test
run: |
export SENZING_PATH="/opt/senzing"
export LD_LIBRARY_PATH="${SENZING_PATH}/er/lib:${SENZING_PATH}/er/lib/macos"
go test -json -v -p 1 ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
3 changes: 2 additions & 1 deletion .github/workflows/go-test-linux-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]

env:
SENZING_LOG_LEVEL: TRACE
SENZING_TOOLS_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/G2/?sslmode=disable
SENZING_TOOLS_DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/G2/?sslmode=disable"

permissions:
contents: read
Expand All @@ -21,6 +21,7 @@ jobs:

services:
postgres:
# https://hub.docker.com/_/postgres
env:
POSTGRES_DB: G2
POSTGRES_PASSWORD: postgres
Expand Down

0 comments on commit f75d380

Please sign in to comment.