version: 2.1 orbs: win: circleci/windows@1.0.0 workflows: workflow: jobs: - go-test: name: Go 1.15 docker-image: circleci/golang:1.14 run-lint: true with-coverage: true - go-test: name: Go 1.14 docker-image: circleci/golang:1.14 - go-test-windows: name: Windows - benchmarks jobs: go-test: parameters: docker-image: type: string run-lint: type: boolean default: false with-coverage: type: boolean default: false docker: - image: <> environment: CIRCLE_TEST_REPORTS: /tmp/circle-reports CIRCLE_ARTIFACTS: /tmp/circle-artifacts steps: - checkout - run: name: install go-junit-report command: go get -u github.com/jstemmer/go-junit-report - run: name: build command: make build - when: condition: <> steps: - run: name: lint command: make lint - run: name: test command: | mkdir -p $CIRCLE_TEST_REPORTS mkdir -p $CIRCLE_ARTIFACTS make test | tee $CIRCLE_ARTIFACTS/report.txt - run: name: Process test results command: go-junit-report < $CIRCLE_ARTIFACTS/report.txt > $CIRCLE_TEST_REPORTS/junit.xml when: always - when: condition: <> steps: - run: name: Verify test coverage command: make test-coverage - run: name: Store coverage results command: cp build/coverage* /tmp/circle-artifacts when: always - store_test_results: path: /tmp/circle-reports - store_artifacts: path: /tmp/circle-artifacts go-test-windows: executor: name: win/vs2019 shell: powershell.exe environment: GOPATH: C:\Users\VssAdministrator\go steps: - checkout - run: go version - run: go build ./... - run: go test ./... benchmarks: docker: - image: circleci/golang:1.14 environment: CIRCLE_ARTIFACTS: /tmp/circle-artifacts steps: - checkout - run: go build ./... - run: name: Run benchmarks command: | mkdir -p $CIRCLE_ARTIFACTS make benchmarks | tee $CIRCLE_ARTIFACTS/benchmarks.txt - store_artifacts: path: /tmp/circle-artifacts