1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Fixtures
# Captures container fixture machines on a GitHub runner (cgroup v2, Docker) with
# tests/fixtures/capture.sh and uploads them as an artifact. Run by hand; the
# result is reviewed before it is committed. Nothing here runs on push.
on:
workflow_dispatch:
inputs:
job:
description: Which fixtures to capture
type: choice
options:
default: containers
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
capture:
name: Capture container fixtures
if: inputs.job == 'containers'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: docker-cgroup2-limited
run: |
mkdir -p out
docker run --rm --memory=256m --memory-reservation=200m --cpus=1.5 --cpuset-cpus=0-1 \
-v "$PWD/tests/fixtures:/work:ro" -v "$PWD/out:/out" ubuntu:24.04 \
bash /work/capture.sh docker-cgroup2-limited /out
- name: minimal-scratch
# A scratch or distroless image has no shell to run the script in, so this
# emulates one: the os-release files and any machine id are removed first.
run: |
docker run --rm -v "$PWD/tests/fixtures:/work:ro" -v "$PWD/out:/out" ubuntu:24.04 \
bash -c 'rm -f /etc/os-release /usr/lib/os-release /etc/machine-id /var/lib/dbus/machine-id && bash /work/capture.sh minimal-scratch /out'
- name: Summary
run: |
sudo chown -R "$(id -u):$(id -g)" out
for d in out/*; do echo "== $d"; cat "$d/CAPTURED.txt"; done
- uses: actions/upload-artifact@v5
with:
name: fixtures
path: out/
retention-days: 7
distros:
name: Capture the distribution corpus
if: inputs.job == 'distros'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Capture
run: bash tests/fixtures/capture_distros.sh tests/fixtures/distros.list out/distros
- uses: actions/upload-artifact@v5
with:
name: distros
path: out/distros/
retention-days: 7
cgroup1:
name: Capture docker-cgroup1-limited (cgroup v1 VM)
if: inputs.job == 'cgroup1'
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v5
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Install QEMU
run: sudo apt-get update && sudo apt-get install -y qemu-system-x86 qemu-utils cloud-image-utils
- name: Capture
run: bash tests/fixtures/capture_cgroup1_vm.sh out
- uses: actions/upload-artifact@v5
with:
name: cgroup1
path: out/
retention-days: 7