diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..28fe0423 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,27 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/golang:1.10 + environment: + - DBR_TEST_MYSQL_DSN=root:root@tcp(127.0.0.1:3306)/circle_test + - DBR_TEST_POSTGRES_DSN=postgres://postgres:mysecretpassword@127.0.0.1:5432/postgres?sslmode=disable + - image: percona:5.7.20 + environment: + - MYSQL_DATABASE=circle_test + - MYSQL_ROOT_PASSWORD=root + - image: postgres:9.6-alpine + + working_directory: /go/src/github.com/gocraft/dbr + steps: + - checkout + - run: + name: Install dockerize + command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz + environment: + DOCKERIZE_VERSION: v0.3.0 + - run: + name: Wait for db + command: dockerize -wait tcp://127.0.0.1:3306 -wait tcp://127.0.0.1:5432 -timeout 1m + - run: go get -t ./... + - run: go test -v -cover ./... diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 7fb688a8..00000000 --- a/circle.yml +++ /dev/null @@ -1,5 +0,0 @@ -## Customize the test machine -machine: - environment: - DBR_TEST_MYSQL_DSN: "ubuntu:@unix(/var/run/mysqld/mysqld.sock)/circle_test?charset=utf8" - DBR_TEST_POSTGRES_DSN: "postgres://ubuntu:@127.0.0.1:5432/circle_test"