From ba732b853259a57adbf2ee899903170a540ac700 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 4 Mar 2024 11:42:20 +0100 Subject: [PATCH] workflow, osbuild-mpp: run with cache and use GH cache Share cache between runs and also put into GH cache accross runs. --- .github/workflows/generate.yml | 6 ++++++ tools/osbuild-mpp | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 4e148b38..c20fb92d 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -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: diff --git a/tools/osbuild-mpp b/tools/osbuild-mpp index 56513038..53ff5064 100755 --- a/tools/osbuild-mpp +++ b/tools/osbuild-mpp @@ -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