workflow, osbuild-mpp: run with cache and use GH cache

Share cache between runs and also put into GH cache accross runs.
This commit is contained in:
Michael Vogt 2024-03-04 11:42:20 +01:00 committed by Ondřej Budai
parent 1ea7b4943c
commit ba732b8532
2 changed files with 10 additions and 1 deletions

View file

@ -36,9 +36,15 @@ jobs:
generate_test_data:
name: "Test Data"
runs-on: ubuntu-latest
env:
OSBUILD_MPP_CACHEDIR: "/var/tmp/osbuild-mpp-cache"
steps:
- name: "Clone Repository"
uses: actions/checkout@v3
- name: Cache metadata
uses: actions/cache@v4
with:
path: /var/tmp/osbuild-mpp-cache
- name: "Regenerate Test Data"
uses: osbuild/containers/src/actions/privdocker@552e30cf1b4ed19c6ddaa57f96c342b3dff4227b
with:

View file

@ -1804,8 +1804,11 @@ def main():
m = ManifestFile.load(args.src, overrides, defaults, args.searchdirs)
cachedir = args.cachedir
if cachedir is None:
cachedir = os.getenv("OSBUILD_MPP_CACHEDIR")
with tempfile.TemporaryDirectory() as persistdir:
m.solver_factory = DepSolverFactory(args.cachedir, persistdir)
m.solver_factory = DepSolverFactory(cachedir, persistdir)
m.process_format()
m.solver_factory = None