UAlbertaALTLab / korp-frontend

Frontend for Korp, a frontend for the IMS Open Corpus Workbench (CWB).
https://spraakbanken.gu.se/en/tools/korp
MIT License
1 stars 1 forks source link

caching not working during deployment workflows #36

Closed dwhieb closed 3 years ago

dwhieb commented 3 years ago

The step for caching Node modules isn't working during deployment workflows:

https://github.com/UAlbertaALTLab/korp-frontend/runs/1981096876?check_suite_focus=true

andrewdotn commented 3 years ago

I don’t remember if we tested whether this worked, but based on some GitHub docs, the hfst-optimized-lookup workflow you helped me with does:

if: steps.cache.outputs.cache-hit != 'true'

https://github.com/UAlbertaALTLab/hfst-optimized-lookup/blob/9f2f534c241ae57596f334d3a371fb7a932a1d26/.github/workflows/test.yml#L37

andrewdotn commented 3 years ago

That said, weirdly, today the daily scheduled build failed claiming a library that should have been installed from the cache couldn’t be found. So I removed the caching step and the build passed.

dwhieb commented 3 years ago

Thanks @andrewdotn! That conditional looks useful. I think I'm missing a key parameter in the workflow file, so I'll try that too.

dwhieb commented 3 years ago

hashFiles returns an empty string when it can't find the file, which is probably what's happening here. See https://github.com/actions/cache/issues/536.

In this case, the workflow file is looking for package-lock.json, which doesn't exist in the repo. It should look for yarn.lock instead.

dwhieb commented 3 years ago

Fixed by 8768c447adb82b8643c409d4159d62bc279f1fba.