Skip to content

Commit a2412d9

Browse files
author
Miguel Varela Ramos
authored
Add go cache to circle ci lint and test workflows (#2356)
1 parent 533852e commit a2412d9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.circleci/config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ commands:
1515
rm -rf go*.tar.gz
1616
echo 'export PATH=$PATH:/usr/local/go/bin' >> $BASH_ENV
1717
echo 'export PATH=$PATH:~/go/bin' >> $BASH_ENV
18+
mkdir ~/go
19+
echo 'export GOPATH=~/go' >> $BASH_ENV
1820
1921
quay-login:
2022
description: Log Docker agent into Quay.io
@@ -72,6 +74,10 @@ jobs:
7274
steps:
7375
- checkout
7476
- install-go
77+
- restore_cache:
78+
keys:
79+
- go-mod-v1-{{ checksum "go.sum" }}
80+
- go-mod-v1-
7581
- run:
7682
name: Install Linting Tools
7783
command: |
@@ -81,6 +87,10 @@ jobs:
8187
- run:
8288
name: Lint
8389
command: make lint
90+
- save_cache:
91+
key: go-mod-v1-{{ checksum "go.sum" }}
92+
paths:
93+
- "~/go/pkg/mod"
8494

8595
test:
8696
machine:
@@ -89,6 +99,10 @@ jobs:
8999
steps:
90100
- checkout
91101
- install-go
102+
- restore_cache:
103+
keys:
104+
- go-mod-v1-{{ checksum "go.sum" }}
105+
- go-mod-v1-
92106
- run:
93107
name: Initialize Credentials
94108
command: |
@@ -110,6 +124,10 @@ jobs:
110124
- run:
111125
name: Go Tests
112126
command: make test
127+
- save_cache:
128+
key: go-mod-v1-{{ checksum "go.sum" }}
129+
paths:
130+
- "~/go/pkg/mod"
113131

114132
build-and-upload-cli:
115133
docker:

0 commit comments

Comments
 (0)