diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d31187..f65fa68 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,12 +3,9 @@ version: 2.1 jobs: "test": parameters: - v: + version: type: string default: "latest" - latest: - type: boolean - default: false golint: type: boolean default: true @@ -19,7 +16,7 @@ jobs: type: string default: "" docker: - - image: "circleci/golang:<< parameters.v >>" + - image: "circleci/golang:<< parameters.version >>" working_directory: /go/src/github.com/elithrar/admission-control environment: GO111MODULE: "on" @@ -43,20 +40,20 @@ jobs: - run: name: "Run golint" command: > - if [ << parameters.latest >> = true ] && [ << parameters.golint >> = true ]; then + if [ << parameters.version >> = "latest" ] && [ << parameters.golint >> = true ]; then go get -u golang.org/x/lint/golint golint ./... fi - run: name: "Run gofmt" command: > - if [[ << parameters.latest >> = true ]]; then + if [[ << parameters.version >> = "latest" ]]; then diff -u <(echo -n) <(gofmt -d -e .) fi - run: name: "Run go vet" command: > - if [[ << parameters.latest >> = true ]]; then + if [[ << parameters.version >> = "latest" ]]; then go vet -v ./... fi - run: @@ -66,7 +63,7 @@ jobs: "build-container": docker: - - image: docker:18 + - image: docker:19 working_directory: /go/src/github.com/elithrar/admission-control steps: - checkout @@ -81,19 +78,10 @@ jobs: docker build -t elithrar/admissiond-example . workflows: - build: + tests: jobs: - test: - name: "latest" - v: "latest" - latest: true - - test: - name: "v1.15" - v: "1.15" - - test: - name: "v1.14" - v: "1.14" - - test: - name: "v1.13" - v: "1.13" + matrix: + parameters: + version: ["latest", "1.15", "1.14", "1.13"] - "build-container"