mirror of
https://github.com/theupriser/steamify-cachyos-live-iso.git
synced 2026-10-02 15:10:26 +02:00
ci: cache pacman packages (build, test, suites), the VMs' packages and the CachyOS ISO
This commit is contained in:
1 parent
a74500b692
commit
af30018bd9
2 files changed
+69
-11
No files matched your search
@@ -34,11 +34,19 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
steamify: ${{ steps.tag.outputs.steamify }}
|
steamify: ${{ steps.tag.outputs.steamify }}
|
||||||
steps:
|
steps:
|
||||||
- name: Tools
|
# First only what the cache action needs (node, git), then the caches, then the rest from the restored cache.
|
||||||
|
- name: Node and git
|
||||||
run: |
|
run: |
|
||||||
pacman-key --init && pacman-key --populate
|
pacman-key --init && pacman-key --populate
|
||||||
# nodejs: the actions below run in this container
|
pacman -Syu --noconfirm --needed nodejs git
|
||||||
pacman -Syu --noconfirm --needed archiso mkinitcpio-archiso git squashfs-tools grub sudo nodejs curl jq
|
- name: Cache - pacman packages
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /var/cache/pacman/pkg
|
||||||
|
key: pacman-build-${{ github.run_id }}
|
||||||
|
restore-keys: pacman-build-
|
||||||
|
- name: Tools
|
||||||
|
run: pacman -S --noconfirm --needed archiso mkinitcpio-archiso squashfs-tools grub sudo curl jq
|
||||||
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -103,11 +111,29 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
- name: Tools and KVM
|
# First only what the cache action needs (node, git), then the caches, then the rest from the restored cache.
|
||||||
|
- name: Node and git
|
||||||
run: |
|
run: |
|
||||||
pacman-key --init && pacman-key --populate
|
pacman-key --init && pacman-key --populate
|
||||||
# nodejs: the actions below run in this container
|
pacman -Syu --noconfirm --needed nodejs git
|
||||||
pacman -Syu --noconfirm --needed qemu-desktop edk2-ovmf openssh libarchive procps-ng util-linux python git nodejs sudo
|
- name: Cache - pacman packages
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /var/cache/pacman/pkg
|
||||||
|
key: pacman-test-${{ github.run_id }}
|
||||||
|
restore-keys: pacman-test-
|
||||||
|
# The guests' packages (VM_CACHE, shared into the VMs): downloaded once for every run.
|
||||||
|
- name: Cache - the VMs' packages
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /root/vms/pkg-cache
|
||||||
|
key: vmpkg-${{ needs.build.outputs.steamify }}-${{ github.run_id }}
|
||||||
|
restore-keys: |
|
||||||
|
vmpkg-${{ needs.build.outputs.steamify }}-
|
||||||
|
vmpkg-
|
||||||
|
- name: Tools and KVM
|
||||||
|
run: |
|
||||||
|
pacman -S --noconfirm --needed qemu-desktop edk2-ovmf openssh libarchive procps-ng util-linux python git sudo
|
||||||
# Fail at once, with a reason, when the runner cannot run a VM with KVM.
|
# Fail at once, with a reason, when the runner cannot run a VM with KVM.
|
||||||
[ -c /dev/kvm ] || { echo "::error::no /dev/kvm in this container: the runner needs KVM (and privileged containers)"; exit 1; }
|
[ -c /dev/kvm ] || { echo "::error::no /dev/kvm in this container: the runner needs KVM (and privileged containers)"; exit 1; }
|
||||||
nproc; free -g | sed -n 2p; df -h . | tail -n 1
|
nproc; free -g | sed -n 2p; df -h . | tail -n 1
|
||||||
@@ -169,11 +195,29 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
- name: Tools and KVM
|
# First only what the cache action needs (node, git), then the caches, then the rest from the restored cache.
|
||||||
|
- name: Node and git
|
||||||
run: |
|
run: |
|
||||||
pacman-key --init && pacman-key --populate
|
pacman-key --init && pacman-key --populate
|
||||||
# nodejs: the actions below run in this container
|
pacman -Syu --noconfirm --needed nodejs git
|
||||||
pacman -Syu --noconfirm --needed qemu-desktop edk2-ovmf openssh libarchive procps-ng util-linux python git nodejs sudo
|
- name: Cache - pacman packages
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /var/cache/pacman/pkg
|
||||||
|
key: pacman-test-${{ github.run_id }}
|
||||||
|
restore-keys: pacman-test-
|
||||||
|
# The guests' packages (VM_CACHE, shared into the VMs): downloaded once for every run.
|
||||||
|
- name: Cache - the VMs' packages
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /root/vms/pkg-cache
|
||||||
|
key: vmpkg-${{ needs.build.outputs.steamify }}-${{ github.run_id }}
|
||||||
|
restore-keys: |
|
||||||
|
vmpkg-${{ needs.build.outputs.steamify }}-
|
||||||
|
vmpkg-
|
||||||
|
- name: Tools and KVM
|
||||||
|
run: |
|
||||||
|
pacman -S --noconfirm --needed qemu-desktop edk2-ovmf openssh libarchive procps-ng util-linux python git sudo
|
||||||
# Fail at once, with a reason, when the runner cannot run a VM with KVM.
|
# Fail at once, with a reason, when the runner cannot run a VM with KVM.
|
||||||
[ -c /dev/kvm ] || { echo "::error::no /dev/kvm in this container: the runner needs KVM (and privileged containers)"; exit 1; }
|
[ -c /dev/kvm ] || { echo "::error::no /dev/kvm in this container: the runner needs KVM (and privileged containers)"; exit 1; }
|
||||||
nproc; free -g | sed -n 2p; df -h . | tail -n 1
|
nproc; free -g | sed -n 2p; df -h . | tail -n 1
|
||||||
@@ -195,6 +239,20 @@ jobs:
|
|||||||
|
|
||||||
# The suites run on a plain CachyOS VM (Plasma, no Steamify): the newest CachyOS ISO, installed once;
|
# The suites run on a plain CachyOS VM (Plasma, no Steamify): the newest CachyOS ISO, installed once;
|
||||||
# every block then starts from a fresh overlay of that VM.
|
# every block then starts from a fresh overlay of that VM.
|
||||||
|
# The CachyOS ISO (~3 GB) is cached per release (the release get-iso.sh would download).
|
||||||
|
- name: CachyOS release
|
||||||
|
id: cachyos
|
||||||
|
run: |
|
||||||
|
rel="$(curl -fsL https://cachyos.org/download/ | grep -oE 'cachyos-desktop-linux-[0-9]+' | head -n 1)"
|
||||||
|
echo "release=${rel:?no CachyOS release found}" >> "$GITHUB_OUTPUT"
|
||||||
|
- name: Cache - the CachyOS ISO
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
steamify-cachyos-dev/cachyos.iso
|
||||||
|
steamify-cachyos-dev/cachyos.iso.version
|
||||||
|
key: cachyos-iso-${{ steps.cachyos.outputs.release }}
|
||||||
|
|
||||||
- name: Plain CachyOS VM
|
- name: Plain CachyOS VM
|
||||||
env:
|
env:
|
||||||
CI: "1"
|
CI: "1"
|
||||||
@@ -206,9 +264,8 @@ jobs:
|
|||||||
mkdir -p ~/.ssh ~/vms/pkg-cache
|
mkdir -p ~/.ssh ~/vms/pkg-cache
|
||||||
ssh-keygen -q -t ed25519 -N "" -C steamify-vm -f ~/.ssh/steamify-vm_ed25519
|
ssh-keygen -q -t ed25519 -N "" -C steamify-vm -f ~/.ssh/steamify-vm_ed25519
|
||||||
cd steamify-cachyos-dev
|
cd steamify-cachyos-dev
|
||||||
./get-iso.sh
|
./get-iso.sh # does nothing when the cached ISO is the current release
|
||||||
VM_DIR="$HOME/vms/steamify-vm" scripts/vminstall.sh --iso cachyos.iso
|
VM_DIR="$HOME/vms/steamify-vm" scripts/vminstall.sh --iso cachyos.iso
|
||||||
rm -f cachyos.iso
|
|
||||||
|
|
||||||
# Two suites at a time, 4 GB and 2 vCPUs each (vmsuite.sh).
|
# Two suites at a time, 4 GB and 2 vCPUs each (vmsuite.sh).
|
||||||
- name: vmtest.sh (every suite)
|
- name: vmtest.sh (every suite)
|
||||||
|
|||||||
@@ -131,4 +131,5 @@ Full write-up, with every trap: `steamify-iso-release` in steamify-cachyos-dev.
|
|||||||
GitHub doesn't have, and the release with them. GitHub releases can't hold the ISO (2 GB per file).
|
GitHub doesn't have, and the release with them. GitHub releases can't hold the ISO (2 GB per file).
|
||||||
- Gitea needs `[repository.release] FILE_MAX_SIZE` above the ISO (413 otherwise) and the runner
|
- Gitea needs `[repository.release] FILE_MAX_SIZE` above the ISO (413 otherwise) and the runner
|
||||||
`container: privileged: true` (archiso mounts `/proc`); the workflow's `--privileged` option is ignored.
|
`container: privileged: true` (archiso mounts `/proc`); the workflow's `--privileged` option is ignored.
|
||||||
|
- Caches (`actions/cache`, the runner's cache server): pacman's package cache per job kind (build, test), the VMs' packages (`VM_CACHE`, `~/vms/pkg-cache`) and the CachyOS ISO for the suites, per release. Each job first installs only node and git, restores the caches, then installs the rest.
|
||||||
- CachyOS's own `Desktop ISO` workflow (`build.yml`) is removed here; the test job of iso-2-gitea-build.yml replaces it.
|
- CachyOS's own `Desktop ISO` workflow (`build.yml`) is removed here; the test job of iso-2-gitea-build.yml replaces it.
|
||||||
Reference in new issue
Block a user