Skip to content

Commit 89ec2a8

Browse files
allisonkarlitskayacgwalters
authored andcommitted
.github/workflows: cache "patched tools"
Installing the build dependencies and building the tools takes a long time. Signed-off-by: Allison Karlitskaya <[email protected]>
1 parent 9ab8712 commit 89ec2a8

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/examples.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060
python3-libvirt \
6161
qemu-system \
6262
systemd-boot-efi
63-
sudo apt-get build-dep systemd e2fsprogs
6463
6564
- name: Get a newer podman for heredoc support (from plucky)
6665
run: |
@@ -70,10 +69,20 @@ jobs:
7069
7170
- uses: actions/checkout@v4
7271

73-
- name: Install patched tools
72+
- name: Check cache for patched tools
73+
uses: actions/cache@v3
74+
with:
75+
path: ~/bin
76+
key: patched-tools-bin-${{ hashFiles('examples/common/install-patched-tools') }}
77+
78+
- name: Ensure patched tools are installed
7479
run: |
75-
mkdir ~/bin
76-
examples/common/install-patched-tools ~/bin
80+
set -eux
81+
if [ ! -x "$HOME/bin/mkfs.ext4" ]; then
82+
sudo apt-get build-dep systemd e2fsprogs
83+
mkdir ~/bin
84+
examples/common/install-patched-tools ~/bin
85+
fi
7786
7887
- name: Run example tests
7988
run: |

0 commit comments

Comments
 (0)