Skip to content

Commit 6643b74

Browse files
committed
Use setup-bink action for composefs integration tests
Replace inline CI setup steps with the shared setup-bink composite action to avoid duplication across workflow files. Assisted-by: Claude Opus 4.6 (1M context) Signed-off-by: Alice Frosi <afrosi@redhat.com>
1 parent e610bf9 commit 6643b74

1 file changed

Lines changed: 5 additions & 99 deletions

File tree

.github/workflows/integration-tests-composefs.yml

Lines changed: 5 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -25,106 +25,12 @@ jobs:
2525

2626
steps:
2727
- name: Checkout code
28-
uses: actions/checkout@v4
28+
uses: actions/checkout@v7
2929

30-
- name: Configure kernel for nested containers
31-
run: |
32-
sudo aa-teardown 2>/dev/null || true
33-
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
34-
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
35-
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
36-
37-
- name: Enable KSM (Kernel Same-page Merging)
38-
run: |
39-
sudo sh -c 'echo 1 > /sys/kernel/mm/ksm/run'
40-
sudo sh -c 'echo 5000 > /sys/kernel/mm/ksm/pages_to_scan'
41-
cat /sys/kernel/mm/ksm/run
42-
43-
- name: Set up Go
44-
uses: actions/setup-go@v5
45-
with:
46-
go-version-file: go.mod
47-
cache: true
48-
49-
- name: Install system dependencies
50-
run: |
51-
sudo apt-get update
52-
sudo apt-get install -y \
53-
podman \
54-
libgpgme-dev \
55-
libbtrfs-dev \
56-
libdevmapper-dev \
57-
pkg-config
58-
59-
- name: Set up KVM
60-
run: |
61-
sudo chmod 666 /dev/kvm
62-
ls -la /dev/kvm
63-
64-
- name: Configure Podman
65-
run: |
66-
podman --version
67-
sudo mkdir -p /etc/containers
68-
echo '{"defaultAction":"SCMP_ACT_ALLOW"}' | sudo tee /etc/containers/seccomp.json
69-
printf '[containers]\napparmor_profile = "unconfined"\nseccomp_profile = "/etc/containers/seccomp.json"\n' | sudo tee /etc/containers/containers.conf
70-
grep -q '^root:' /etc/subuid || echo 'root:100000:65536' | sudo tee -a /etc/subuid
71-
grep -q '^root:' /etc/subgid || echo 'root:100000:65536' | sudo tee -a /etc/subgid
72-
sudo systemctl start podman.socket
73-
sudo podman info --format '{{.Store.GraphRoot}}'
74-
75-
- name: Build bink binary
76-
run: sudo make build-bink
77-
78-
- name: Verify prerequisites
79-
run: |
80-
test -f ./bink
81-
sudo podman images --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}"
82-
df -h /
83-
free -h
84-
85-
- name: Get image digests
86-
id: digests
87-
run: |
88-
ALL_DIGESTS=""
89-
for img in $BINK_IMAGES $EXTERNAL_IMAGES; do
90-
digest=$(skopeo inspect --no-creds "docker://${img}" --format '{{.Digest}}')
91-
echo "${img}: ${digest}"
92-
ALL_DIGESTS="${ALL_DIGESTS}${digest}"
93-
done
94-
echo "hash=$(echo -n "${ALL_DIGESTS}" | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
95-
96-
- name: Restore cached images
97-
id: image-cache
98-
uses: actions/cache/restore@v4
99-
with:
100-
path: /tmp/podman-image-cache
101-
key: podman-images-v2-composefs-${{ steps.digests.outputs.hash }}
102-
103-
- name: Load cached images
104-
if: steps.image-cache.outputs.cache-hit == 'true'
105-
run: |
106-
for f in /tmp/podman-image-cache/*.tar; do
107-
sudo podman load -i "$f"
108-
done
109-
sudo podman images --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}"
110-
111-
- name: Pre-pull container images
112-
if: steps.image-cache.outputs.cache-hit != 'true'
113-
run: |
114-
mkdir -p /tmp/podman-image-cache
115-
for img in $BINK_IMAGES $EXTERNAL_IMAGES; do
116-
sudo podman pull "$img"
117-
name=$(echo "$img" | sed 's|[/:]|_|g')
118-
sudo podman save -o "/tmp/podman-image-cache/${name}.tar" "$img"
119-
done
120-
sudo chown -R $(id -u):$(id -g) /tmp/podman-image-cache
121-
122-
- name: Save image cache
123-
if: steps.image-cache.outputs.cache-hit != 'true'
124-
uses: actions/cache/save@v4
30+
- name: Setup bink
31+
uses: ./.github/actions/setup-bink
12532
with:
126-
path: /tmp/podman-image-cache
127-
key: podman-images-v2-composefs-${{ steps.digests.outputs.hash }}
33+
cache-key-prefix: composefs
12834

12935
- name: Run composefs integration tests
13036
run: sudo make test-integration-composefs
@@ -139,7 +45,7 @@ jobs:
13945

14046
- name: Upload logs
14147
if: failure()
142-
uses: actions/upload-artifact@v4
48+
uses: actions/upload-artifact@v7
14349
with:
14450
name: test-logs-composefs
14551
path: /tmp/bink-logs/

0 commit comments

Comments
 (0)