diff --git a/.circleci/config.yml b/.circleci/config.yml index e56a45f..1131415 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,6 @@ -version: 2 +version: 2.1 + + jobs: test: docker: @@ -20,9 +22,37 @@ jobs: command: go build -v - run: command: make build_test + macos: + macos: + xcode: "10.2.0" + environment: + GOPATH: /Users/distiller/go + GOVERSION: "1.13.8" + steps: + - checkout + - run: + command: | + curl -O https://dl.google.com/go/go${GOVERSION}.darwin-amd64.pkg + sudo installer -pkg go${GOVERSION}.darwin-amd64.pkg -target / + - run: + command: | + make init_tools + mkdir -p ${GOPATH}/src/github.com/shirou/ + mv /Users/distiller/project /Users/distiller/go/src/github.com/shirou/gopsutil + - run: + command: | + export PATH=$GOPATH/bin:$PATH + cd /Users/distiller/go/src/github.com/shirou/gopsutil && dep ensure + - run: + command: | + cd /Users/distiller/go/src/github.com/shirou/gopsutil && go build -v + - run: + command: | + cd /Users/distiller/go/src/github.com/shirou/gopsutil && make macos_test workflows: version: 2 test: jobs: + - macos - test diff --git a/Makefile b/Makefile index fb99923..4f228eb 100644 --- a/Makefile +++ b/Makefile @@ -33,5 +33,9 @@ ifeq ($(shell uname -s), Darwin) endif @echo 'Successfully built on all known operating systems' +macos_test: + CGO_ENABLED=0 GOOS=darwin go test ./... | $(BUILD_FAIL_PATTERN) + CGO_ENABLED=1 GOOS=darwin go test ./... | $(BUILD_FAIL_PATTERN) + init_tools: go get github.com/golang/dep/cmd/dep