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 macOS CI from Travis to Actions #1182

Closed
wants to merge 3 commits into from
Closed
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
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 .
23 changes: 0 additions & 23 deletions .travis.yml
Expand Up @@ -106,29 +106,6 @@ jobs:
- export MYSQL_TEST_ADDR=127.0.0.1:3307
- export MYSQL_TEST_CONCURRENT=1

- os: osx
osx_image: xcode11.4
addons:
homebrew:
packages:
- mysql
update: true
go: 1.15.x
before_install:
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls
before_script:
- export cross_compile=false
- 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;'
- export MYSQL_TEST_USER=gotest
- export MYSQL_TEST_PASS=secret
- export MYSQL_TEST_ADDR=127.0.0.1:3306
- export MYSQL_TEST_CONCURRENT=1

script:
- go test -v -covermode=count -coverprofile=coverage.out
- go vet ./...
Expand Down