# Github actions cache not working

**URL:** <https://discourse.julialang.org/t/github-actions-cache-not-working/92341>\
**Category:** Tooling\
**Tags:** github, github-actions\
**Created:** [December 30, 2022, 11:32pm UTC](https://discourse.julialang.org/t/github-actions-cache-not-working/92341 "2022-12-30T23:32:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zStupan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zstupan/32/45442_2.png) [@zStupan](https://discourse.julialang.org/u/zStupan)\
**Post date:** [December 30, 2022, 11:32pm UTC](https://discourse.julialang.org/t/github-actions-cache-not-working/92341/1 "2022-12-30T23:32:33Z")

</div>

Hi,  
I’m trying to make a simple test workflow for my project using github actions:

```yaml
name: CI
on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main
    tags: ["*"]
jobs:
  test:
    name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        version:
          - '1.8'
          - 'nightly'
        os:
          - ubuntu-latest
        arch:
          - x64
    steps:
      - uses: actions/checkout@v3
      - uses: julia-actions/setup-julia@v1
        with:
          version: ${{ matrix.version }}
          arch: ${{ matrix.arch }}
      - name: Cache artifacts
        uses: actions/cache@v3
        env:
          cache-name: cache-artifacts
        with:
          path: |
            ~/.julia/artifacts
          key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
          restore-keys: |
            ${{ runner.os }}-test-${{ env.cache-name }}-
            ${{ runner.os }}-test-
            ${{ runner.os }}-
      - uses: julia-actions/julia-buildpkg@v1
      - uses: julia-actions/julia-runtest@v1
      - uses: julia-actions/julia-processcoverage@v1
      - uses: codecov/codecov-action@v3
        with:
          file: lcov.info
  docs:
    name: Documentation
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: julia-actions/setup-julia@v1
        with:
          version: '1.8'
      - run: |
          julia --project=docs -e '
            using Pkg
            Pkg.develop(PackageSpec(path=pwd()))
            Pkg.instantiate()'
      - run: |
          julia --project=docs -e '
            using Documenter: doctest
            using MyPackage
            doctest(MyPackage)'
      - run: julia --project=docs docs/make.jl
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

```

The tests run and everything, but I’ve noticed that the artifacts don’t actually get cached (from Post Cache artifacts):

```plaintext
Post job cleanup.
Warning: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.

```

Now, I’ve copied this caching section, and in fact most of this workflow from [OpenML.jl](https://github.com/JuliaAI/OpenML.jl/blob/dev/.github/workflows/CI.yml) and their runs work as intended.

Does anyone have any idea what I’m doing wrong? Because I’m lost.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [December 31, 2022, 5:19am UTC](https://discourse.julialang.org/t/github-actions-cache-not-working/92341/2 "2022-12-31T05:19:29Z")

</div>

Use [GitHub - julia-actions/cache: A shortcut action to cache Julia artifacts, packages, and registries.](https://github.com/julia-actions/cache)
