Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: Cache base run results to speed up tests #136

Open
sidharthv96 opened this issue Aug 28, 2021 · 6 comments
Open

proposal: Cache base run results to speed up tests #136

sidharthv96 opened this issue Aug 28, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@sidharthv96
Copy link
Contributor

We can use the @actions/cache package to cache the last baseRun report with the base commit hash as key.
So, we can run the action 2x faster for big repos having lots of tests.

@ArtiomTr
Copy link
Owner

Sound good! Thank you for your idea!

@ArtiomTr ArtiomTr added the enhancement New feature or request label Aug 29, 2021
@sidharthv96
Copy link
Contributor Author

The POC is ready, but running into some issue with the cache service.

@FDiskas
Copy link

FDiskas commented Feb 1, 2022

This is actually super cool idea.
Store report.json as a cache key from base commit hash and use https://github.com/actions/cache#skipping-steps-based-on-cache-hit to skip tests if report is available :)
please do not forget this :) it could improve in some case the 2x speed

@ArtiomTr
Copy link
Owner

ArtiomTr commented Feb 1, 2022

Hello @FDiskas 👋,

Yes, the idea is great, however, it is impossible to use @actions/cache without breaking current functionality.
Cache is not working with composite actions due to security limitations. By using standard node12 or node16 runners users will lose the ability to manually setup node environment.

Similar functionality could be achieved by using base-coverage-file option. You should manually collect coverage, and then restore it.

@vgrafe
Copy link

vgrafe commented Sep 9, 2022

fwiw and if it helps, when implementing my own action I did not run into problems caching test results (with key based on the commit sha) while similarily running a composite action: https://github.com/vgrafe/jest-reports/blob/main/src/getCoverageForSha.ts#L21.

Apologies if I missed something out.

@ArtiomTr
Copy link
Owner

ArtiomTr commented Sep 9, 2022

Hello @vgrafe 👋,

Thank you for the suggestion, I will try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants