Go test linux - mssql #1266
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Go test linux - mssql | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "15 7 * * *" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
| cancel-in-progress: true | |
| env: | |
| SENZING_LOG_LEVEL: TRACE | |
| SENZING_TOOLS_DATABASE_URL: "mssql://sa:Passw0rd@localhost:1433/G2/?TrustServerCertificate=yes" | |
| permissions: {} | |
| jobs: | |
| sdk-versions: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| senzingsdk-versions: ${{ steps.cfg.outputs.senzingsdk-versions }} | |
| steps: | |
| - id: cfg | |
| uses: senzing-factory/build-resources/sdk-versions@v4 | |
| go-test-linux: | |
| name: "Go test with Senzing: ${{ matrix.senzingsdk-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }} - mssql" | |
| needs: sdk-versions | |
| permissions: | |
| contents: read | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go: ["1.26"] | |
| os: [ubuntu-latest] | |
| senzingsdk-version: ${{ fromJSON(needs.sdk-versions.outputs.senzingsdk-versions) }} | |
| timeout-minutes: 30 | |
| 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:2025-latest | |
| ports: | |
| - 1433:1433 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Setup go ${{ matrix.go }} | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Set up gotestfmt | |
| uses: gotesttools/gotestfmt-action@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get install -y \ | |
| unixodbc \ | |
| libgssapi-krb5-2 | |
| - name: Copy rootfs files | |
| run: | | |
| sudo cp --verbose --recursive rootfs/* / | |
| sudo cp --verbose --recursive testdata/mssql/rootfs/* / | |
| - name: Install Senzing SDK | |
| uses: senzing-factory/github-action-install-senzing-sdk@v4 | |
| with: | |
| packages-to-install: "senzingsdk-runtime senzingsdk-setup" | |
| senzingsdk-version: ${{ matrix.senzingsdk-version }} | |
| - name: Install MS SQL libraries | |
| run: | | |
| curl -sSL -O https://packages.microsoft.com/config/ubuntu/"$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)"/packages-microsoft-prod.deb | |
| sudo dpkg -i --force-confnew packages-microsoft-prod.deb | |
| rm packages-microsoft-prod.deb | |
| sudo apt-get update | |
| sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 | |
| sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18 | |
| sudo apt-get install -y unixodbc-dev | |
| - name: Create database | |
| run: | | |
| /opt/mssql-tools18/bin/sqlcmd -C -P "Passw0rd" -Q "CREATE DATABASE G2" -S "localhost,1433" -U "sa" | |
| - name: Run go test | |
| run: | | |
| export SENZING_PATH="/opt/senzing" | |
| export LD_LIBRARY_PATH="${SENZING_PATH}/er/lib" | |
| export ODBCINI="/opt/microsoft/msodbcsql18/etc/odbc.ini" | |
| export ODBCSYSINI="/opt/microsoft/msodbcsql18/etc" | |
| go test -json -v -p 1 ./... 2>&1 | tee /tmp/gotest.log | gotestfmt | |
| slack-notification: | |
| needs: [go-test-linux] | |
| if: ${{ always() && contains(fromJSON('["failure", "cancelled"]'), needs.go-test-linux.result ) && (github.ref_name == github.event.repository.default_branch || github.event_name == 'schedule') }} | |
| secrets: | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
| SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} | |
| uses: senzing-factory/build-resources/.github/workflows/build-failure-slack-notification.yaml@v4 | |
| with: | |
| job-status: ${{ needs.go-test-linux.result }} |