version: 2.1 orbs: win: circleci/windows@1.0.0 workflows: workflow: jobs: - go-test: name: Go 1.19 docker-image: cimg/go:1.19 run-lint: true - go-test: name: Go 1.18 docker-image: cimg/go:1.18 - go-test-windows: name: Windows jobs: go-test: parameters: docker-image: type: string run-lint: 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 install github.com/jstemmer/go-junit-report/v2@v2.0.0 - when: condition: <> steps: - run: make lint - run: name: Run tests command: | mkdir -p $CIRCLE_TEST_REPORTS mkdir -p $CIRCLE_ARTIFACTS trap "go-junit-report < $CIRCLE_ARTIFACTS/report.txt > $CIRCLE_TEST_REPORTS/junit.xml" EXIT make test | tee $CIRCLE_ARTIFACTS/report.txt - 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: name: download Go 1.18.5 command: | $ErrorActionPreference = "Stop" $installerUrl = "https://go.dev/dl/go1.18.5.windows-amd64.msi" (New-Object System.Net.WebClient).DownloadFile($installerUrl, "go1.18.5.windows-amd64.msi") - run: name: install Go 1.18.5 command: Start-Process msiexec.exe -Wait -ArgumentList "/I go1.18.5.windows-amd64.msi /quiet" - run: go version - run: name: build and test command: | go test -race ./...