Skip to content

Commit 6b31c72

Browse files
committed
Cache sysupgrade files across runs.
1 parent 8fb4e08 commit 6b31c72

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

.github/workflows/vm.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,35 @@ jobs:
339339
echo `hostname` `cat $key` >>$sshconf/ssh_known_hosts
340340
done
341341
342+
- name: Fetch sysupgrade version
343+
run: |
344+
ver=$(curl -s https://cdn.openbsd.org/pub/OpenBSD/snapshots/amd64/BUILDINFO)
345+
echo "SNAPSHOT_VERSION=${ver}" >> $GITHUB_ENV
346+
- name: Cache sysupgrade
347+
id: cache-sysupgrade
348+
uses: actions/cache@v4
349+
with:
350+
key: openbsd-sysupgrade ${{ env.SNAPSHOT_VERSION }}
351+
path: /tmp/_sysupgrade/
352+
- name: Restore sysupgrade from cache
353+
run: |
354+
mkdir -p /tmp/_sysupgrade/
355+
rsync -av /tmp/_sysupgrade/ openbsd:/home/_sysupgrade/
342356
- name: upgrade to latest snapshot
343-
run: ssh -q openbsd sysupgrade -s || true
357+
run: ssh -q openbsd sysupgrade -s -k || true
344358
- name: wait for upgrade
345359
run: |
346360
SECONDS=0; sleep 10; while ! ssh -q -oConnectTimeout=1 openbsd true; do sleep 10; echo waited ${SECONDS}s; done
347361
ssh openbsd uname -a
362+
- name: retrieve sysupgrade to cache
363+
run: rsync -av openbsd:/home/_sysupgrade/ /tmp/_sysupgrade/
364+
- name: save sysupgrade cache
365+
if: steps.cache-sysupgrade.output.cache-hit != 'true' && ${{ hashFiles('/tmp/_sysupgrade/xshare78.tgz') != '' }}
366+
uses: actions/cache/save@v4
367+
with:
368+
key: openbsd-sysupgrade ${{ env.SNAPSHOT_VERSION }}
369+
path: /tmp/_sysupgrade/
370+
348371
- name: checkout upstream source
349372
shell: openbsd {0}
350373
run: |

0 commit comments

Comments
 (0)