# Gitlab ci cache julia packages

**URL:** <https://discourse.julialang.org/t/gitlab-ci-cache-julia-packages/8639>\
**Category:** General Usage\
**Created:** [January 27, 2018, 3:26pm UTC](https://discourse.julialang.org/t/gitlab-ci-cache-julia-packages/8639 "2018-01-27T15:26:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wikunia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wikunia/32/2180_2.png) [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Post date:** [January 27, 2018, 3:26pm UTC](https://discourse.julialang.org/t/gitlab-ci-cache-julia-packages/8639/1 "2018-01-27T15:26:25Z")

</div>

I have my own private gitlab server but probably this is general gitlab stuff.

How can I cache my julia packages which are dependencies of the package I want to test?

If I run `Pkg.test("PkgName")` everything gets saved in `/root/.julia/v0.6` but it seems like gitlab doesn’t allow to cache stuff in that level.

I always get this warning:  
`WARNING: /root/.julia/v0.6: no matching files`

I have this part inside my `.gitlab-ci.yml`

```julia
 cache:
    paths:
      - /root/.julia/v0.6

```

Thanks for any ideas. For example can I install the packages in a local folder (local in `/builds/` which seems to be the directory where something can be cached)

---

<div class="post-metadata">

**Author:** ![itan1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/itan1/32/44584_2.png) [@itan1](https://discourse.julialang.org/u/itan1)\
**Post date:** [July 3, 2023, 2:36pm UTC](https://discourse.julialang.org/t/gitlab-ci-cache-julia-packages/8639/2 "2023-07-03T14:36:20Z")

</div>

You can change the [JULIA\_DEPOT\_PATH](https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_DEPOT_PATH) which is where the package manager will look for packages. If you set it to a folder inside your project directory, you can then add that folder to the GitLab cache.

For example inside your `.gitlab-ci.yml` file add:

```julia
variables:
  # override DEPOT_PATH to install packages in the project
  # folder, because gitlab can only cache files whthin it
  JULIA_DEPOT_PATH: "$CI_PROJECT_DIR/.julia"
cache:
  paths:
    - $JULIA_DEPOT_PATH

```
