feat(github_actions): Consolidate apt cache directory

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
This commit is contained in:
Lucas Schwiderski 2021-03-26 18:53:08 +01:00
parent 9bc8c28c90
commit 645156b3c0
No known key found for this signature in database
GPG Key ID: AA12679AAA6DF4D8
2 changed files with 6 additions and 14 deletions

View File

@ -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

View File

@ -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: |