From 6443603f332bac613809d9816a8cebff88bf6b43 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Mon, 16 Sep 2019 07:56:30 -0400 Subject: add circle ci and rm gitlab ci --- .circleci/config.yml | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 26 -------------------- 2 files changed, 67 insertions(+), 26 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .gitlab-ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..717e7b6 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,67 @@ +version: 2 + +alias: + &setup-steps: + - run: go get ./... + - run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /go/bin v1.17.1 + &pipeline-steps: + - run: + name: run static analysis & tests + command: make ci + +jobs: + golang-1.11-pipeline: + working_directory: /go/src/github.com/wagoodman/dive + docker: + - image: circleci/golang:1.11 + steps: + - checkout + - restore_cache: + keys: + - golang-1.11-{{ checksum "go.sum" }} + - *setup-steps + - save_cache: + key: golang-1.11-{{ checksum "go.sum" }} + paths: + - "/go/pkg/mod" + - *pipeline-steps + + golang-1.12-pipeline: + working_directory: /go/src/github.com/wagoodman/dive + docker: + - image: circleci/golang:1.12 + steps: + - checkout + - restore_cache: + keys: + - golang-1.12-{{ checksum "go.sum" }} + - *setup-steps + - save_cache: + key: golang-1.12-{{ checksum "go.sum" }} + paths: + - "/go/pkg/mod" + - *pipeline-steps + + golang-1.13-pipeline: + working_directory: /go/src/github.com/wagoodman/dive + docker: + - image: circleci/golang:1.13 + steps: + - checkout + - restore_cache: + keys: + - golang-1.13-{{ checksum "go.sum" }} + - *setup-steps + - save_cache: + key: golang-1.13-{{ checksum "go.sum" }} + paths: + - "/go/pkg/mod" + - *pipeline-steps + +workflows: + version: 2 + commit: + jobs: + - golang-1.11-pipeline + - golang-1.12-pipeline + - golang-1.13-pipeline diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 7ec9505..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,26 +0,0 @@ -image: golang:1.12.5 - -cache: - paths: - - .cache - -variables: - GOPATH: $CI_PROJECT_DIR/.cache - -stages: - - setup - - validation - -setup: - stage: setup - script: - - mkdir -p .cache - - go get ./... - - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1 - -validation: - stage: validation - before_script: - - export PATH="$GOPATH/bin:$PATH" - script: - - make ci -- cgit v1.2.3 From 18b5fdbe799ab6b11f247af548cc8cd3be1e61af Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Tue, 17 Sep 2019 20:39:00 -0400 Subject: syntax fix --- .circleci/config.yml | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 717e7b6..4efc2c7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,62 +1,68 @@ version: 2 -alias: - &setup-steps: - - run: go get ./... - - run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /go/bin v1.17.1 - &pipeline-steps: - - run: - name: run static analysis & tests - command: make ci - jobs: golang-1.11-pipeline: - working_directory: /go/src/github.com/wagoodman/dive + working_directory: /home/circleci/app docker: - image: circleci/golang:1.11 + environment: + GO111MODULE: "on" steps: - checkout - restore_cache: keys: - golang-1.11-{{ checksum "go.sum" }} - - *setup-steps + - run: go get ./... + - run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /go/bin v1.17.1 - save_cache: key: golang-1.11-{{ checksum "go.sum" }} paths: - "/go/pkg/mod" - - *pipeline-steps + - run: + name: run static analysis & tests + command: make ci golang-1.12-pipeline: - working_directory: /go/src/github.com/wagoodman/dive + working_directory: /home/circleci/app docker: - image: circleci/golang:1.12 + environment: + GO111MODULE: "on" steps: - checkout - restore_cache: keys: - golang-1.12-{{ checksum "go.sum" }} - - *setup-steps + - run: go get ./... + - run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /go/bin v1.17.1 - save_cache: key: golang-1.12-{{ checksum "go.sum" }} paths: - "/go/pkg/mod" - - *pipeline-steps + - run: + name: run static analysis & tests + command: make ci golang-1.13-pipeline: - working_directory: /go/src/github.com/wagoodman/dive + working_directory: /home/circleci/app docker: - image: circleci/golang:1.13 + environment: + GO111MODULE: "on" steps: - checkout - restore_cache: keys: - golang-1.13-{{ checksum "go.sum" }} - - *setup-steps + - run: go get ./... + - run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /go/bin v1.17.1 - save_cache: key: golang-1.13-{{ checksum "go.sum" }} paths: - "/go/pkg/mod" - - *pipeline-steps + - run: + name: run static analysis & tests + command: make ci workflows: version: 2 -- cgit v1.2.3 From 9236307e2946e2de9b3abe1c2be6a1f6f641b418 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Tue, 17 Sep 2019 21:13:46 -0400 Subject: golang 1.13 support for linting --- .circleci/config.yml | 9 +++------ Makefile | 4 ++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4efc2c7..67c9154 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,8 +12,7 @@ jobs: - restore_cache: keys: - golang-1.11-{{ checksum "go.sum" }} - - run: go get ./... - - run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /go/bin v1.17.1 + - run: make setup - save_cache: key: golang-1.11-{{ checksum "go.sum" }} paths: @@ -33,8 +32,7 @@ jobs: - restore_cache: keys: - golang-1.12-{{ checksum "go.sum" }} - - run: go get ./... - - run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /go/bin v1.17.1 + - run: make setup - save_cache: key: golang-1.12-{{ checksum "go.sum" }} paths: @@ -54,8 +52,7 @@ jobs: - restore_cache: keys: - golang-1.13-{{ checksum "go.sum" }} - - run: go get ./... - - run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /go/bin v1.17.1 + - run: make setup - save_cache: key: golang-1.13-{{ checksum "go.sum" }} paths: diff --git a/Makefile b/Makefile index 58de9a7..06cf507 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,10 @@ lint: build generate-test-data: docker build -t dive-test:latest -f .data/Dockerfile.test-image . && docker image save -o .data/test-docker-image.tar dive-test:latest && echo "Exported test data!" +setup: + go get ./... + curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /go/bin v1.18.0 + clean: rm -rf build go clean -- cgit v1.2.3