linux_task:
  container:
    image: golang:latest
  env:
    GO111MODULE: on
    GOPATH: /tmp/go
    CIRRUS_WORKING_DIR: /tmp/go/src/github.com/${CIRRUS_REPO_FULL_NAME}
  build_script:
    - go version
    - go get ./...
    - go build -race -v ./...
  test_script:
    - go test -race -v ./...

osx_task:
  osx_instance:
    image: big-sur-base
  env:
    GO111MODULE: on
    GOPATH: /tmp/go
    PATH: ${GOPATH}/bin:${PATH}
    CIRRUS_WORKING_DIR: /tmp/go/src/github.com/${CIRRUS_REPO_FULL_NAME}
  install_script:
    - brew install go
  build_script:
    - go version
    - go get ./...
    - go build -race -v ./...
  test_script:
    - go test -race -v ./...

windows_task:
  windows_container:
    image: cirrusci/windowsservercore:2019
  env:
    GO111MODULE: on
    GOPATH: C:\golang
    PATH: ${GOPATH}\bin;C:\Program Files\Go\bin;C:\Users\ContainerAdministrator\go\bin;${PATH}
    CIRRUS_WORKING_DIR: C:\golang\src\github.com\${CIRRUS_REPO_FULL_NAME}
  install_script:
    - choco install -y golang
  build_script:
    - go version
    - go get ./...
    - go build -race -v ./...
  test_script:
    - go test -race -v ./...

freebsd_task:
  freebsd_instance:
    image: freebsd-12-2-release-amd64
  env:
    GO111MODULE: on
    GOPATH: /tmp/go
    PATH: ${GOPATH}/bin:${PATH}
    CIRRUS_WORKING_DIR: /tmp/go/src/github.com/${CIRRUS_REPO_FULL_NAME}
  install_script:
    - pkg install -y go git
  build_script:
    - go version
    - go get ./...
    - go build -race -v ./...
  test_script:
    - go test -race -v ./...
