Skip to content

Commit

Permalink
Merge pull request #224 from CircleCI-Public/pre-fetch-modules
Browse files Browse the repository at this point in the history
[CIRCLE-15262]: Pre-fetch and cache go modules
  • Loading branch information
Zachary Scott authored Dec 10, 2018
2 parents 0204e7a + c13333f commit 8bee1e6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,46 @@ executors:
environment:
CGO_ENABLED: 0

commands:
gomod:
steps:
- restore_cache:
keys: [v1-gomod-]
- run:
name: Download go module dependencies
command: go mod download
- save_cache:
key: v1-gomod-{{ checksum "go.sum" }}
paths: [/go/pkg/mod]

jobs:
test:
executor: go
steps:
- checkout
- gomod
- run: make test

coverage:
executor: go
environment:
CGO_ENABLED: 1
steps:
- checkout
- gomod
- run: make cover
- store_artifacts:
path: ./coverage.txt
destination: coverage.txt
- codecov/upload:
path: coverage.txt

docs:
executor: go
steps:
- checkout
- run: sudo apt-get install pandoc
- gomod
- run: go run main.go usage
- store_artifacts:
path: ./docs
Expand Down Expand Up @@ -77,6 +94,7 @@ jobs:
git config --global user.name $GH_NAME
git tag -a "v0.1.$CIRCLE_BUILD_NUM" -m "Release v0.1.$CIRCLE_BUILD_NUM"
git push origin "v0.1.$CIRCLE_BUILD_NUM"
- gomod
- run:
name: Release
command: goreleaser
Expand Down

0 comments on commit 8bee1e6

Please sign in to comment.