diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..297120f --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,41 @@ +version: 2.1 + +jobs: + build: + working_directory: ~/repo + docker: + - image: cimg/go:1.17.7 + + - image: cimg/postgres:14.0 + auth: + username: postgres + password: $DOCKERHUB_PASSWORD + environment: + POSTGRES_USER: postgres + POSTGRES_DB: pgcli_test + DATABASE_PASSWORD: $DOCKERHUB_PASSWORD + + steps: + - checkout + - restore_cache: + keys: + - go-mod-v4-{{ checksum "go.sum" }} + - run: + name: Install Dependencies + command: | + export GO111MODULE=on + go mod download + go install github.com/axw/gocov/gocov@v1.0.0 + - save_cache: + key: go-mod-v4-{{ checksum "go.sum" }} + paths: + - "/go/pkg/mod" + - run: + name: Run tests + command: | + gocov test ./... | gocov report + +workflows: + pg_cli: + jobs: + - build