Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
15b1cff2
Commit
15b1cff2
authored
Mar 13, 2020
by
Hüseyin Güner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added go module cache support
parent
97dc741e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
doc/ci/caching/index.md
doc/ci/caching/index.md
+25
-0
No files found.
doc/ci/caching/index.md
View file @
15b1cff2
...
...
@@ -329,6 +329,31 @@ rspec:
-
rspec spec
```
### Caching Go dependencies
Assuming your project is using
[
Go Modules
](
https://github.com/golang/go/wiki/Modules
)
to install
the Go dependencies, the following example defines
`cache`
globally so that
all jobs inherit it. Go modules are installed in
`vendor/`
and
are cached per-branch:
```
yaml
image
:
golang:1.13
# Cache libraries in between jobs
cache
:
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
vendor/
before_script
:
-
go mod vendor
test
:
script
:
-
go test -mod vendor ./... -v -short
```
## Availability of the cache
Caching is an optimization, but isn't guaranteed to always work, so you need to
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment