forked from go-sql-driver/mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move tests from Travis to Actions (go-sql-driver#1183)
* Run macOS CI on Github Actions * no cover * Fix workflow name * Actions: Add linux test * fix * fix * fix go 1.10 * Remove .travis.yml
- Loading branch information
Showing
3 changed files
with
86 additions
and
138 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Test on Linux | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
go: [1.15, 1.14, 1.13, 1.12, 1.11, "1.10"] | ||
mysql: ["mysql:8.0"] | ||
include: | ||
- go: 1.15 | ||
mysql: "mysql:5.7" | ||
- go: 1.15 | ||
mysql: "mysql:5.5" | ||
- go: 1.15 | ||
mysql: "mariadb:5.5" | ||
- go: 1.15 | ||
mysql: "mariadb:10.1" | ||
|
||
services: | ||
mysql: | ||
image: ${{ matrix.mysql }} | ||
ports: | ||
- 3306:3306 | ||
env: | ||
MYSQL_DATABASE: gotest | ||
MYSQL_USER: gotest | ||
MYSQL_PASSWORD: secret | ||
MYSQL_ALLOW_EMPTY_PASSWORD: yes | ||
# How can we add these options? | ||
#options: --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1 | ||
|
||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- uses: actions/checkout@v2 | ||
- name: Run test | ||
env: | ||
MYSQL_TEST_USER: gotest | ||
MYSQL_TEST_PASS: secret | ||
MYSQL_TEST_ADDR: 127.0.0.1:3307 | ||
MYSQL_TEST_CONCURRENT: 1 | ||
run: | | ||
go test -v -covermode=count -coverprofile=coverage.out | ||
go vet ./... | ||
gofmt -d -s . |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Test on macOS | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up MySQL | ||
run: | | ||
brew install mysql | ||
echo -e "[server]\ninnodb_log_file_size=256MB\ninnodb_buffer_pool_size=512MB\nmax_allowed_packet=16MB\nlocal_infile=1" >> /usr/local/etc/my.cnf | ||
mysql.server start | ||
mysql -uroot -e 'CREATE USER gotest IDENTIFIED BY "secret"' | ||
mysql -uroot -e 'GRANT ALL ON *.* TO gotest' | ||
mysql -uroot -e 'create database gotest;' | ||
- name: Set up Go | ||
run: | | ||
go install golang.org/x/tools/cmd/cover | ||
- name: Run tests | ||
env: | ||
MYSQL_TEST_USER: gotest | ||
MYSQL_TEST_PASS: secret | ||
MYSQL_TEST_ADDR: 127.0.0.1:3306 | ||
MYSQL_TEST_CONCURRENT: 1 | ||
run: | | ||
go test -v -covermode=count -coverprofile=coverage.out | ||
go vet ./... | ||
gofmt -d -s . |
This file was deleted.
Oops, something went wrong.