open-nomad/.circleci/config/jobs/test-windows.yml
2020-05-15 10:15:37 -04:00

80 lines
2.8 KiB
YAML

executor: go-windows
steps:
- run: git config --global core.autocrlf false
- checkout
- run:
name: Setup
command: |
mkdir -p $GOBIN
mkdir -p $GOTESTSUM_PATH
echo "$GOLANG_VERSION" > ~/GOLANG_VERSION.txt
echo "$GOTESTSUM_VERSION" > ~/GOTESTSUM_VERSION.txt
echo "$VAULT_VERSION" > ~/VAULT_VERSION.txt
- restore_cache:
keys:
- win-golang-cache-{{ .Branch }}-{{ checksum "~/GOLANG_VERSION.txt" }}-v1
- restore_cache:
keys:
- win-gotestsum-cache-{{ .Branch }}-{{ checksum "~/GOTESTSUM_VERSION.txt" }}-v1
- restore_cache:
keys:
- win-vault-cache-{{ .Branch }}-{{ checksum "~/VAULT_VERSION.txt" }}-v1
- restore_cache:
keys:
- win-gobuild-cache-{{ .Branch }}-{{ checksum "/gopath/src/github.com/hashicorp/nomad/api/go.sum" }}-v1
- install-golang:
target_directory: "c:"
os: windows
- run: go version
- save_cache:
key: win-golang-cache-{{ .Branch }}-{{ checksum "~/GOLANG_VERSION.txt" }}-v1
paths:
- /go
- run: go version
- install-gotestsum:
os: windows
version: $GOTESTSUM_VERSION
- save_cache:
key: win-gotestsum-cache-{{ .Branch }}-{{ checksum "~/GOTESTSUM_VERSION.txt" }}-v1
paths:
- c:\Windows\gotestsum.exe
- install-vault:
os: windows
version: $VAULT_VERSION
- save_cache:
key: win-vault-cache-{{ .Branch }}-{{ checksum "~/VAULT_VERSION.txt" }}-v1
paths:
- c:\Windows\vault.exe
- run: vault version
- run: choco install make
- run:
name: Install golang dependencies
command: |
export PATH=$PATH:c/gopath/bin
go get -u github.com/kardianos/govendor
go get -u github.com/ugorji/go/codec/codecgen
go get -u github.com/hashicorp/go-bindata/go-bindata
go get -u github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs
go get -u github.com/a8m/tree/cmd/tree
go get -u github.com/magiconair/vendorfmt/cmd/vendorfmt
go get -u github.com/golang/protobuf/protoc-gen-go
go get -u gotest.tools/gotestsum
- run:
name: Build nomad
command: |
go build -o $GOBIN\nomad.exe
- save_cache:
key: win-gobuild-cache-{{ .Branch }}-{{ checksum "/gopath/src/github.com/hashicorp/nomad/api/go.sum" }}-v1
paths:
- c:\Users\circleci\AppData\Local\go-build
- run:
name: Run tests with gotestsum
command: |
# Only test docker driver tests for now
gotestsum --format=short-verbose --junitfile $GOTESTSUM_PATH/results.xml github.com/hashicorp/nomad/drivers/docker github.com/hashicorp/nomad/client/lib/fifo github.com/hashicorp/nomad/client/logmon
- store_test_results:
path: c:\tmp\test-reports
- store_artifacts:
path: c:\tmp\test-reports