mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 13:05:47 +00:00
ci: save the Robolectric jar cache from main only (#3604)
A pull request's cache entry is visible only to that pull request, so each PR stored its own ~830 MB copy that no other PR could restore, while new PRs started from main's incomplete set and downloaded the rest from Maven Central, where the 429s come from. The copies also kept the repository at its 10 GB cache limit and pushed out other caches.
This commit is contained in:
1 parent
c514c59018
commit
ecbda604e2
2 files changed
+10
-1
No files matched your search
@@ -33,6 +33,13 @@ class CiChecksTest(unittest.TestCase):
|
||||
robolectric = [cache['path'] for cache in caches if cache['key'].startswith('robolectric-')]
|
||||
self.assertEqual(robolectric, ['${{ steps.robolectric-jars.outputs.path }}'] * 2)
|
||||
|
||||
def test_only_main_saves_the_robolectric_cache(self):
|
||||
steps = yaml.safe_load((ROOT / '.github/workflows/unit-tests.yml').read_text())['jobs']['unit-tests']['steps']
|
||||
saves = [step for step in steps if step.get('uses', '').startswith('actions/cache/save')
|
||||
and step['with']['key'].startswith('robolectric-')]
|
||||
self.assertEqual(len(saves), 1)
|
||||
self.assertIn("github.event_name != 'pull_request'", saves[0]['if'])
|
||||
|
||||
def test_unit_test_retry_requires_maven_exception(self):
|
||||
steps = yaml.safe_load((ROOT / '.github/workflows/unit-tests.yml').read_text())['jobs']['unit-tests']['steps']
|
||||
run = next(step['run'] for step in steps if step.get('id') == 'unit-tests')
|
||||
|
||||
Reference in new issue
Block a user