add CI build

This commit is contained in:
Eli Bishop
2020-06-09 11:34:38 -07:00
parent 90effd9f15
commit 865adb9f3d

82
.circleci/config.yml Normal file
View File

@@ -0,0 +1,82 @@
version: 2.1
orbs:
win: circleci/windows@1.0.0
workflows:
workflow:
jobs:
- go-build:
name: Go 1.14
docker-image: circleci/golang:1.14
build-as-module: true
- go-build:
name: Go 1.13
docker-image: circleci/golang:1.13
build-as-module: true
- go-build:
name: Go 1.12
docker-image: circleci/golang:1.12
- go-build:
name: Go 1.11
docker-image: circleci/golang:1.11
- go-build:
name: Go 1.10
docker-image: circleci/golang:1.10
- go-build:
name: Go 1.9
docker-image: circleci/golang:1.9
- go-build:
name: Go 1.8
docker-image: circleci/golang:1.8
- go-build-windows:
name: Windows
jobs:
go-build:
parameters:
docker-image:
type: string
build-as-module:
type: boolean
default: false
docker:
- image: <<parameters.docker-image>>
working_directory: /go/src/github.com/launchdarkly/go-ntlm-proxy-auth
steps:
- checkout
- unless:
condition: <<parameters.build-as-module>>
steps:
- run: go get -t .
- run: go build
go-test-windows:
executor:
name: win/vs2019
shell: powershell.exe
environment:
GOPATH: C:\Users\VssAdministrator\go
PACKAGE_PATH: github.com/launchdarkly/go-ntlm-proxy-auth
steps:
- checkout
- run: go version
- run:
name: move source
command: |
go env GOPATH
mkdir ${env:GOPATH}\src\${env:PACKAGE_PATH}
mv * ${env:GOPATH}\src\${env:PACKAGE_PATH}
- run:
name: build and test
command: |
cd ${env:GOPATH}\src\${env:PACKAGE_PATH}
go get -t .
go test -v -race ./...