Skip to content

Commit

Permalink
ci: Test mssql
Browse files Browse the repository at this point in the history
  • Loading branch information
timabell committed Jan 28, 2024
1 parent dd0b203 commit c97c00a
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 '<YourPassword>'
/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:
Expand Down

0 comments on commit c97c00a

Please sign in to comment.