Closed Natrinicle closed 2 years ago
I added the regression test here: https://github.com/awalsh128/cache-apt-pkgs-action-ci/pull/3 but haven't had a chance to actually test it so I'm not certain it will work. Might require a bit of tweaking. I also had to expose the cache-key in the outputs so that the regression test would be able to access it.
It should generate on pull requests but it may be pulling from the main branch instead of the pull. I'll need to look into that. Thanks for the hard work.
Ah right I forgot that pull requests get merged into a staging branch and then I create a pull request into main. I should still setup the tests for the pull fork too though.
Reverted pull into main because list version test was failing. Keeping in staging to get fixed and will then pull again.
I think the most transparent way to do this is to include a property that shows the deps installed and regenerate the cache based on that. Keeping the same cache and updating would defeat the purpose IMO. WDYT @Natrinicle ?
Make sure to keep the cache up to date as package versions change upstream. Also, allow specific package versions to be selected.
APT installs more packages than just those explicitly listed. This can lead to issues of missing files when the cache is restored. Use a dry-run to get a full list of packages APT will install and cache those as well but don't include them in the cache-key.