Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tests from Travis to Actions #1183

Merged
merged 8 commits into from Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/linux.yaml
@@ -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 .
36 changes: 36 additions & 0 deletions .github/workflows/mac.yaml
@@ -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 .
138 changes: 0 additions & 138 deletions .travis.yml

This file was deleted.