add rockhopper command for test

This commit is contained in:
c9s 2022-05-03 16:26:33 +08:00
parent 9b5ba3780c
commit 2371438bde
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 9 additions and 5 deletions

View File

@ -16,9 +16,9 @@ jobs:
redis-version:
- 6.2
env:
DB_DATABASE: bbgo
DB_USER: root
DB_PASSWORD: root
MYSQL_DATABASE: bbgo
MYSQL_USER: "root"
MYSQL_PASSWORD: "root"
steps:
@ -36,7 +36,7 @@ jobs:
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
mysql -e 'CREATE DATABASE ${{ env.MYSQL_DATABASE }};' -u${{ env.MYSQL_USER }} -p${{ env.MYSQL_PASSWORD }}
- name: Set up redis
uses: shogo82148/actions-setup-redis@v1
@ -52,6 +52,10 @@ jobs:
- name: Install Migration Tool
run: go install github.com/c9s/rockhopper/cmd/rockhopper@v1.2.1
- name: Test Migration SQL Files For MySQL
run: |
rockhopper --config rockhopper_mysql.yaml up
- name: Build
run: go build -v ./cmd/bbgo

View File

@ -8,7 +8,7 @@ dialect: mysql
# dsn: "root:123123@unix(/opt/local/var/run/mysql57/mysqld.sock)/bbgo_dev?parseTime=true"
# tcp connection to mysql with password
# dsn: "root:123123@tcp(localhost:3306)/bbgo_dev?parseTime=true"
dsn: "root:root@tcp(localhost:3306)/bbgo?parseTime=true"
# tcp connection to mysql without password
# dsn: "root@tcp(localhost:3306)/bbgo_dev?parseTime=true"