-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Golang CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-go/ for more details | ||
version: 2.1 | ||
|
||
jobs: | ||
"golang-1_14": &template | ||
machine: | ||
# https://circleci.com/docs/2.0/configuration-reference/#available-machine-images | ||
image: ubuntu-2004:202010-01 | ||
# docker_layer_caching: true | ||
|
||
# https://circleci.com/docs/2.0/configuration-reference/#resource_class | ||
resource_class: medium | ||
|
||
# Leave working directory unspecified and use defaults: | ||
# https://circleci.com/blog/go-v1.11-modules-and-circleci/ | ||
# working_directory: /go/src/github.com/golang-migrate/migrate | ||
|
||
environment: | ||
GO111MODULE: "on" | ||
GO_VERSION: "1.14.x" | ||
|
||
steps: | ||
# - setup_remote_docker: | ||
# version: 19.03.13 | ||
# docker_layer_caching: true | ||
- restore_cache: | ||
keys: | ||
- go-mod-v1-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }} | ||
- run: curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | ||
- run: curl -sfL -o ~/bin/golangci-lint.sh https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | ||
- run: chmod +x ~/bin/gimme ~/bin/golangci-lint.sh | ||
- run: eval "$(gimme $GO_VERSION)" | ||
- run: golangci-lint.sh -b ~/bin v1.33.0 | ||
- checkout | ||
- run: golangci-lint run | ||
- run: make test COVERAGE_DIR=/tmp/coverage | ||
- save_cache: | ||
key: go-mod-v1-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }} | ||
paths: | ||
- "/go/pkg/mod" | ||
- run: go get github.com/mattn/goveralls | ||
- run: goveralls -service=circle-ci -coverprofile /tmp/coverage/combined.txt | ||
|
||
"golang-1_15": | ||
<<: *template | ||
environment: | ||
GO_VERSION: "1.15.x" | ||
|
||
workflows: | ||
version: 2 | ||
build: | ||
jobs: | ||
- "golang-1_14" | ||
- "golang-1_15" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
run: | ||
# timeout for analysis, e.g. 30s, 5m, default is 1m | ||
timeout: 2m | ||
timeout: 5m | ||
linters: | ||
enable: | ||
#- golint | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ARG DOCKER_IMAGE | ||
FROM $DOCKER_IMAGE | ||
|
||
RUN apk add --no-cache git gcc musl-dev make | ||
|
||
WORKDIR /go/src/github.com/golang-migrate/migrate | ||
|
||
ENV GO111MODULE=on | ||
ENV COVERAGE_DIR=/tmp/coverage | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
COPY . ./ | ||
|
||
CMD ["make", "test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters