question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Post actions/cache@v1 takes 4+ hours to complete

See original GitHub issue

I was directed here by support. I suspect this is related to #95.

I have a Node repository using Yarn, and when the Post cache action runs it takes around 5 hours to complete, and when it does complete it doesn’t seem to actually successfully cache anything (so subsequent builds continue to take 5 hours).

Sat, 29 Feb 2020 07:01:21 GMT
##[debug]..Evaluating hashFiles:
Sat, 29 Feb 2020 07:01:21 GMT
##[debug]....Evaluating String:
Sat, 29 Feb 2020 07:01:21 GMT
##[debug]....=> 'yarn.lock'
Sat, 29 Feb 2020 07:01:21 GMT
##[debug]Search root directory: '/home/runner/work/proj/proj'
Sat, 29 Feb 2020 07:26:52 GMT
##[debug]Search pattern: '/home/runner/work/proj/proj/yarn.lock'
Sat, 29 Feb 2020 11:46:48 GMT
##[debug]Found 4942714 files
Sat, 29 Feb 2020 11:46:48 GMT
##[debug]1 matches to hash

In the debug logs I can see it’s likely related to the hashFiles call. I don’t know why it’s searching though when my hashFiles is set to just a single file: key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
dhadkacommented, Mar 4, 2020

Hi @jagregory , thanks for reporting this and sorry for the inconvenience it’s causing. Right now, it’s enumerating all the files and checking for pattern matches. We already have a fix to switch to globbing, which should only scan the directories/files that would match the pattern.

We are starting to roll out this fix, but it may take a few days so we can validate the fix and make sure there are no regressions. I’ll update this issue with the status.

1reaction
jagregorycommented, Apr 20, 2020

OP here, just realised I didn’t provide an update on this: everything is working as expected now. My pipelines have been running for a week or so since the fix was put in place with no issues. I’m personally happy to consider this one fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Caching dependencies to speed up workflows - GitHub Docs
To make your workflows faster and more efficient, you can create and use caches for dependencies and other commonly reused files.
Read more >
How do I cache steps in GitHub actions? - Stack Overflow
At the end of the CI run a post-action is executed to save the updated cache in case the key changes.
Read more >
Caching dependencies to speed up workflows in GitHub Actions
To cache dependencies for a job, you'll need to use GitHub's cache action. The action retrieves a cache identified by a unique key....
Read more >
Caching dependencies on GitHub Actions - Ben Pickles
The simple fix is to declare an initial job whose sole purpose is to do the work of installing dependencies and to make...
Read more >
Optimizing CI/CD Pipelines in GitHub Actions - ActiveState
Let's first look into what's taking so long, and why we need optimization. Why do builds take so long? One of the most...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found