From 190b6205baf783a0cd085f1b523bca36e34ffd77 Mon Sep 17 00:00:00 2001 From: Yongjoo Ahn Date: Mon, 15 Apr 2024 17:52:33 +0900 Subject: [PATCH] [workflow] Fix pbuilder cache permission error - Currently pbuilder workflow does not use stored cache for permission error. This commit resolve the issue. Signed-off-by: Yongjoo Ahn --- .github/workflows/pdebuild.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pdebuild.yml b/.github/workflows/pdebuild.yml index 3a27fd2..cfe8ae8 100644 --- a/.github/workflows/pdebuild.yml +++ b/.github/workflows/pdebuild.yml @@ -52,6 +52,9 @@ jobs: echo "Rebuild required: ${rebuild}" echo "rebuild=${rebuild}" >> "$GITHUB_ENV" - uses: actions/setup-python@v1 + - name: make cache dir for pbuilder + ## prevent permission error + run: sudo mkdir --mode a=rwx --parents /var/cache/pbuilder - name: make cache key if: env.rebuild == '1' id: make-key @@ -62,7 +65,9 @@ jobs: if: env.rebuild == '1' uses: actions/cache@v3 with: - path: /var/cache/pbuilder + path: | + /var/cache/pbuilder/aptcache + /var/cache/pbuilder/base.tgz key: ${{ steps.make-key.outputs.cache_key }} - name: prepare pdebuild if: env.rebuild == '1' @@ -77,6 +82,9 @@ jobs: cat ~/.pbuilderrc sudo mkdir -p /root/ sudo ln -s ~/.pbuilderrc /root/ + - name: make pbuilder base.tgz + if: steps.cache-pbuilder.outputs.cache-hit != 'true' + run: | echo "=== pbuilder create" echo "::group::pbuilder create --allow-untrusted" sudo pbuilder create --allow-untrusted -- 2.7.4