From 645156b3c0bf812303400be9dd1515829ed6325d Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Fri, 26 Mar 2021 18:53:08 +0100 Subject: [PATCH] feat(github_actions): Consolidate apt cache directory Signed-off-by: Lucas Schwiderski --- .github/workflows/apidoc.yml | 10 +++------- .github/workflows/main.yml | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/apidoc.yml b/.github/workflows/apidoc.yml index 741a65176..1d670a269 100644 --- a/.github/workflows/apidoc.yml +++ b/.github/workflows/apidoc.yml @@ -28,17 +28,14 @@ jobs: id: get-date run: echo "::set-output name=date::$(/bin/date -u "+%Y%W")" - - name: Create apt cache directory - run: mkdir /tmp/apt - - name: Cache apt packages id: cache-apt uses: actions/cache@v2 with: - path: /tmp/apt/*.deb + path: /var/cache/apt/archives # The trailing number serves as a version flag that can be incremented # to invalidate the cache after changing the list of packages. - key: ${{ github.workflow }}-${{ runner.os }}-${{ steps.get-date.outputs.date }}-apt-2 + key: ${{ github.workflow }}-${{ runner.os }}-${{ steps.get-date.outputs.date }}-apt-3 - name: Download apt packages if: steps.cache-apt.outputs.cache-hit != 'true' @@ -75,11 +72,10 @@ jobs: xutils-dev \ liblua5.3-dev \ lua5.3 - sudo mv /var/cache/apt/archives/*.deb /tmp/apt/ - name: Install downloaded packages run: | - sudo dpkg -i /tmp/apt/*.deb + sudo dpkg -i /var/cache/apt/archives/*.deb - name: Cache luarocks id: cache-luarocks diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0421c46db..17a8777e9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,17 +79,14 @@ jobs: id: get-date run: echo "::set-output name=date::$(/bin/date -u "+%Y%W")" - - name: Create apt cache directory - run: mkdir /tmp/apt - - name: Cache apt packages id: cache-apt uses: actions/cache@v2 with: - path: /tmp/apt/*.deb + path: /var/cache/apt/archives # The trailing number serves as a version flag that can be incremented # to invalidate the cache after changing the list of packages. - key: ${{ github.workflow }}-${{ runner.os }}-${{ steps.get-date.outputs.date }}-apt-3 + key: ${{ github.workflow }}-${{ runner.os }}-${{ steps.get-date.outputs.date }}-apt-4 - name: Download apt packages if: steps.cache-apt.outputs.cache-hit != 'true' @@ -134,10 +131,9 @@ jobs: xvfb \ zsh \ lua-discount - sudo mv /var/cache/apt/archives/*.deb /tmp/apt/ - name: Install downloaded packages - run: sudo dpkg -i /tmp/apt/*.deb + run: sudo dpkg -i /var/cache/apt/archives/*.deb - name: Install Lua packages run: |