From 33628d531f88cc474947d812bb72402243231162 Mon Sep 17 00:00:00 2001 From: Aaron Longwell Date: Mon, 20 Jun 2022 03:53:35 +0000 Subject: [PATCH] Add circleci --- .circleci/config.yml | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..b9c7c4d --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,45 @@ +# Golang CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-go/ for more details +version: 2 +jobs: + golangci-lint: + docker: + - image: circleci/golang:latest + steps: + - checkout + - run: + # https://golangci-lint.run/usage/install/ + name: Install golangci-lint + # Note: It's likely the below URL's "master" will change to "main" someday. + # The version of golangci-lint being used can be changed with the vN.N.N at the end of this URL. + command: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ~/bin v1.42.0 + + - run: + name: Run Go Linters + command: ~/bin/golangci-lint run . --timeout 2m + + go-build-and-test: + machine: + image: ubuntu-2004:202107-02 + steps: + - checkout + - run: + name: Fetch Dependencies + command: go get -t . + - run: + name: Execute Go Build + command: go build . + - run: + name: Execute Go Tests + command: go test -race -coverprofile=coverage.txt -covermode=atomic + - run: + name: Upload Code Coverage + command: bash <(curl -s https://codecov.io/bash) + +workflows: + version: 2 + build: + jobs: + - golangci-lint + - go-build-and-test