Skip to content

Commit 20b5378

Browse files
committed
Use CircleCI
Squashed commit of the following: commit 5f63ff0 Author: Dale Hui <[email protected]> Date: Mon Jan 25 20:36:57 2021 -0800 Remove unnecessary parameter to checkout commit b877110 Author: Dale Hui <[email protected]> Date: Mon Jan 25 20:30:37 2021 -0800 Give up trying to only push coverage for Go 1.15 via YAML templates commit 6f366c3 Author: Dale Hui <[email protected]> Date: Mon Jan 25 20:27:20 2021 -0800 YAML template merging only works with maps, not scalars, so specify the current directory for "checkout" commit e65ff96 Author: Dale Hui <[email protected]> Date: Mon Jan 25 20:21:30 2021 -0800 Use `go get` instead of `go install` and add template for steps commit fef2a9e Author: Dale Hui <[email protected]> Date: Mon Jan 25 19:59:24 2021 -0800 Push code coverage to coveralls.io - Only push code coverage for latest support version of Go commit 48d78bb Author: Dale Hui <[email protected]> Date: Tue Dec 22 22:24:13 2020 -0800 golangci-lint runs slowly on circle ci machines... commit d47e04f Author: Dale Hui <[email protected]> Date: Tue Dec 22 22:20:35 2020 -0800 Cleanup setup and remove debugging commands commit 063337f Author: Dale Hui <[email protected]> Date: Tue Dec 22 22:17:57 2020 -0800 try using ~/bin commit 57f34fb Author: Dale Hui <[email protected]> Date: Tue Dec 22 22:13:55 2020 -0800 Install golangci-lint in another dir commit 2b5d6d6 Author: Dale Hui <[email protected]> Date: Tue Dec 22 22:03:08 2020 -0800 More go env debugging commit 6719f66 Author: Dale Hui <[email protected]> Date: Tue Dec 22 21:59:24 2020 -0800 Sparate downloading and running of golangci-lint.sh commit 6e9ec9f Author: Dale Hui <[email protected]> Date: Tue Dec 22 21:54:44 2020 -0800 debug gimme env commit 706a43c Author: Dale Hui <[email protected]> Date: Tue Dec 22 21:47:01 2020 -0800 debug go env commit 18694c6 Author: Dale Hui <[email protected]> Date: Tue Dec 22 21:39:53 2020 -0800 Use .x version of Go commit 2e4a87b Author: Dale Hui <[email protected]> Date: Tue Dec 22 21:36:01 2020 -0800 correctly use gimme commit 99a1b83 Author: Dale Hui <[email protected]> Date: Tue Dec 22 21:31:45 2020 -0800 Install golangci-lint after installing requested version of Go commit cecf219 Author: Dale Hui <[email protected]> Date: Tue Dec 22 21:29:48 2020 -0800 Still don't support docker layer caching commit 244ec8f Author: Dale Hui <[email protected]> Date: Tue Dec 22 21:28:33 2020 -0800 Try using machine executor commit 44d3b29 Author: Dale Hui <[email protected]> Date: Tue Dec 22 21:07:09 2020 -0800 Fix docker run commit 525983e Author: Dale Hui <[email protected]> Date: Tue Dec 22 21:03:39 2020 -0800 properly specify build-arg commit d5eed20 Author: Dale Hui <[email protected]> Date: Tue Dec 22 20:54:06 2020 -0800 Try running CircleCI tests in a Docker container commit 35e62d1 Merge: 90268de a53e6fc Author: Dale Hui <[email protected]> Date: Mon Dec 21 20:50:58 2020 -0800 Merge remote-tracking branch 'origin/master' into circleci commit 90268de Author: Dale Hui <[email protected]> Date: Mon Dec 21 20:47:46 2020 -0800 Update golangci lint to v1.33.0 commit d5e0747 Author: Dale Hui <[email protected]> Date: Mon Dec 21 20:44:45 2020 -0800 Don't have access to docker layer caching commit 6aaecb3 Author: Dale Hui <[email protected]> Date: Mon Dec 21 20:43:52 2020 -0800 Don't have access to xlarge commit 275de10 Author: Dale Hui <[email protected]> Date: Mon Dec 21 20:39:14 2020 -0800 CircleCI job names can't have a '.' character commit e1d339f Author: Dale Hui <[email protected]> Date: Mon Dec 21 20:30:51 2020 -0800 Update CircleCI config commit d651949 Author: Dale Hui <[email protected]> Date: Fri Aug 2 00:05:59 2019 -0700 Add config for CircleCI commit 19d7355 Author: Dale Hui <[email protected]> Date: Tue Jul 30 00:12:41 2019 -0700 Update golangci-lint from v1.16.0 to v1.17.1
1 parent a53e6fc commit 20b5378

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

Diff for: .circleci/config.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Golang CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-go/ for more details
4+
version: 2.1
5+
6+
jobs:
7+
"golang-1_14": &template
8+
machine:
9+
# https://circleci.com/docs/2.0/configuration-reference/#available-machine-images
10+
image: ubuntu-2004:202010-01
11+
# docker_layer_caching: true
12+
13+
# https://circleci.com/docs/2.0/configuration-reference/#resource_class
14+
resource_class: medium
15+
16+
# Leave working directory unspecified and use defaults:
17+
# https://circleci.com/blog/go-v1.11-modules-and-circleci/
18+
# working_directory: /go/src/github.com/golang-migrate/migrate
19+
20+
environment:
21+
GO111MODULE: "on"
22+
GO_VERSION: "1.14.x"
23+
24+
steps:
25+
# - setup_remote_docker:
26+
# version: 19.03.13
27+
# docker_layer_caching: true
28+
- restore_cache:
29+
keys:
30+
- go-mod-v1-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}
31+
- run: curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
32+
- run: curl -sfL -o ~/bin/golangci-lint.sh https://install.goreleaser.com/github.com/golangci/golangci-lint.sh
33+
- run: chmod +x ~/bin/gimme ~/bin/golangci-lint.sh
34+
- run: eval "$(gimme $GO_VERSION)"
35+
- run: golangci-lint.sh -b ~/bin v1.33.0
36+
- checkout
37+
- run: golangci-lint run
38+
- run: make test COVERAGE_DIR=/tmp/coverage
39+
- save_cache:
40+
key: go-mod-v1-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}
41+
paths:
42+
- "/go/pkg/mod"
43+
- run: go get github.com/mattn/goveralls
44+
- run: goveralls -service=circle-ci -coverprofile /tmp/coverage/combined.txt
45+
46+
"golang-1_15":
47+
<<: *template
48+
environment:
49+
GO_VERSION: "1.15.x"
50+
51+
workflows:
52+
version: 2
53+
build:
54+
jobs:
55+
- "golang-1_14"
56+
- "golang-1_15"

Diff for: .golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
run:
22
# timeout for analysis, e.g. 30s, 5m, default is 1m
3-
timeout: 2m
3+
timeout: 5m
44
linters:
55
enable:
66
#- golint

Diff for: Dockerfile.circleci

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ARG DOCKER_IMAGE
2+
FROM $DOCKER_IMAGE
3+
4+
RUN apk add --no-cache git gcc musl-dev make
5+
6+
WORKDIR /go/src/github.com/golang-migrate/migrate
7+
8+
ENV GO111MODULE=on
9+
ENV COVERAGE_DIR=/tmp/coverage
10+
11+
COPY go.mod go.sum ./
12+
13+
RUN go mod download
14+
15+
COPY . ./
16+
17+
CMD ["make", "test"]

0 commit comments

Comments
 (0)