blob: 3edb430365b24bd3289d5613602cc65586418b3a [file] [log] [blame]
version: 2.1
orbs:
win: circleci/windows@2.2.0
commands:
win_install_go:
steps:
- run:
command: |
choco install golang --version 1.14.6 --yes
go version
macos_install_go:
steps:
- run:
# just latest stable version of Go as a sanity check
# version specification would require a brew update probably
# so this keeps it faster
command: |
brew install golang
go version
go_build:
steps:
- run: go build ./...
go_test:
steps:
- run: go test -v ./...
jobs:
# combined due to slowness of Go install
macosbuildtest:
macos:
xcode: "12.0.0"
steps:
- macos_install_go
- checkout
- go_build
- go_test
# combined due to slowness of Go install
winbuildtest:
executor:
name: win/default
steps:
- win_install_go
- checkout
- go_build
- go_test
go112_build:
docker:
- image: circleci/golang:1.12
steps:
- checkout
- go_build
go113_build:
docker:
- image: circleci/golang:1.13
steps:
- checkout
- go_build
go114_build:
docker:
- image: circleci/golang:1.14
steps:
- checkout
- go_build
go114_test:
docker:
- image: circleci/golang:1.14
parameters:
test_results:
type: string
default: /tmp/test-results
steps:
- checkout
- go_test
go115_build:
docker:
- image: circleci/golang:1.15
steps:
- checkout
- go_build
go115_test:
docker:
- image: circleci/golang:1.15
parameters:
test_results:
type: string
default: /tmp/test-results
steps:
- checkout
- go_test
go115_vet:
docker:
- image: circleci/golang:1.15
steps:
- checkout
- run: go vet ./...
go115_fmt:
docker:
- image: circleci/golang:1.15
steps:
- checkout
- run: gofmt -s -l .
go115_release:
docker:
- image: circleci/golang:1.15
steps:
- add_ssh_keys:
fingerprints:
- db:cf:97:b8:d6:ac:86:74:96:e1:54:e4:bc:27:2b:d0
- checkout
- run: ./scripts/release/release.sh
workflows:
version: 2
# TODO: add a `nightly` run for checking against TF master branch using TFEXEC_E2ETEST_VERSIONS
pr:
jobs:
- winbuildtest
- macosbuildtest
# build only for these versions
- go112_build
- go113_build
- go114_build
- go114_test:
requires:
- go114_build
- go115_build
- go115_test:
requires:
- go115_build
- go115_vet:
requires:
- go115_build
- go115_fmt:
requires:
- go115_build
release:
jobs:
- winbuildtest
- macosbuildtest
# build only for these versions
- go112_build
- go113_build
- go114_build
- go114_test:
requires:
- go114_build
- go115_build
- go115_test:
requires:
- go115_build
- go115_vet:
requires:
- go115_build
- go115_fmt:
requires:
- go115_build
- trigger-release:
filters:
branches:
only:
- master
type: approval
- go115_release:
filters:
branches:
only:
- master
requires:
- trigger-release
- go112_build
- go113_build
- go114_test
- go115_test
- go115_vet
- go115_fmt
- winbuildtest
- macosbuildtest