Skip to content

Commit

Permalink
ci: Test mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
timabell committed Jan 28, 2024
1 parent e903b14 commit 48511bd
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,42 @@ jobs:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ssetest
mysql:
image: mysql:8.3
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: omgroot
MYSQL_DATABASE: ssetest
MYSQL_USER: ssetestusr
MYSQL_PASSWORD: ssetestusrpass

steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Apt packages
run: sudo apt install sqlite3 postgresql-client gcc-mingw-w64-x86-64 mysql-client
- name: install go-junit-report
run: go install github.com/jstemmer/go-junit-report/v2@latest
- uses: actions/checkout@v4
- name: Apt packages
run: sudo apt install sqlite3 postgresql-client gcc-mingw-w64-x86-64
- name: Install dependencies
run: go get .
- name: Test - mysql
env:
schemaexplorer_driver: mysql
schemaexplorer_live: false
schemaexplorer_mysql_connection_string: "ssetestusr:ssetestusrpass@tcp(localhost:3306)/ssetest"
run: |
pushd .
cd mysql
# Use ip address to stop mysql trying to use sockets, which it does for "localhost"
mysql -h 127.0.0.1 -u root -pomgroot ssetest < test-db.sql
popd
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: Test - sqlite flags
run: |
pushd .
Expand Down
13 changes: 13 additions & 0 deletions mysql/run-mysql-connectionstring.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -e
cd ..

export schemaexplorer_driver=mysql
export schemaexplorer_display_name=mysql-test
export schemaexplorer_live=false
export schemaexplorer_listen_on_port=8831
#export schemaexplorer_mysql_database=ssetest
#export schemaexplorer_mysql_user=ssetestusr
#export schemaexplorer_mysql_password=ssetestusrpass
export schemaexplorer_mysql_connection_string="ssetestusr:ssetestusrpass@tcp(localhost:3306)/ssetest"
go run sse.go

0 comments on commit 48511bd

Please sign in to comment.