diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7956249..d4f24ff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,14 +33,27 @@ jobs: MYSQL_DATABASE: ssetest MYSQL_USER: ssetestusr MYSQL_PASSWORD: ssetestusrpass + mssql: + image: mcr.microsoft.com/mssql/server:2017-latest + env: + SA_PASSWORD: GithubIs2broken + ACCEPT_EULA: Y + ports: + - 1433:1433 + options: --health-cmd="SELECT 1;" --health-interval=10s --health-timeout=5s --health-retries=10 + steps: - name: Setup Go uses: actions/setup-go@v4 with: go-version: ${{ matrix.go-version }} + - name: Add mssql source + run: | + curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list + sudo apt-get update - name: Apt packages - run: sudo apt install sqlite3 postgresql-client gcc-mingw-w64-x86-64 mysql-client + run: sudo apt-get install sqlite3 postgresql-client gcc-mingw-w64-x86-64 mysql-client mssql-tools18 unixodbc-dev - name: install go-junit-report run: go install github.com/jstemmer/go-junit-report/v2@latest - uses: actions/checkout@v4 @@ -109,6 +122,23 @@ jobs: go clean -testcache go test -v sse_test.go \ 2>&1 | go-junit-report -iocopy -set-exit-code -out results-mysql-${{ matrix.go-version }}.xml + - name: Setup - MSSQL + run: | + pushd . + cd mssql + #/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P '' + /opt/mssql-tools18/bin/sqlcmd -h + /opt/mssql-tools18/bin/sqlcmd -S localhost -W -U sa -P GithubIs2broken -d "ssetest" -i test-db.sql + /opt/mssql-tools18/bin/sqlcmd -S localhost -W -U sa -P GithubIs2broken -d "ssetest" -i test-db-ms_descriptions.sql + popd + - name: Test - MSSQL + env: + schemaexplorer_driver: mssql + schemaexplorer_mssql_connection_string: "server=localhost;user id=sa;password=GithubIs2broken;database=ssetest" + run: | + go clean -testcache + go test -json sse_test.go \ + 2>&1 | go-junit-report -parser gojson -iocopy -out results-MSSQL-${{ matrix.go-version }}.xml - name: Upload Go test results uses: actions/upload-artifact@v3 with: