Does anyone know how to https://github.com/actions/cache`lein deps` in github workflows? I have the following as my github workflow, but I’m getting cache not found in github actions:
name: Run Tests
on:
push:
jobs:
test:
runs-on: ${{ matrix.os }}
name: Node ${{ matrix.node }} | OS ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04]
node: [12.x]
steps:
- uses: actions/checkout@v1.0.0
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Cache Deps
id: cache-deps
uses: actions/cache@v1
with:
path: /root/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.6.0
- name: Install dependencies
run: lein deps
if: steps.cache-deps.outputs.cache-hit != 'true'
This is what I get in subsequent deployments:
Run actions/cache@v1
with:
path: /root/.m2/repository
key: Linux-maven-5360f82c800957116727d834bd0b32bcbfce17a5c94f606864cfae4990bf344f
Cache not found for input keys: Linux-maven-5360f82c800957116727d834bd0b32bcbfce17a5c94f606864cfae4990bf344f.Your cache step is much the same as ours, but we have ~/.m2/repository for the path. Don't know if that makes any difference. Have you checked your action logs to see that it is populating the cache?
I don’t know what logs to look at, but I do see a “Post Cache Deps” with:
Post job cleanup.
Warning: Cache already exists. Scope: refs/heads/prit/cache-lein-deps, Key: Linux-maven-5360f82c800957116727d834bd0b32bcbfce17a5c94f606864cfae4990bf344f, Version: (null)
changing to ~/ worked