-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathaction.yml
53 lines (46 loc) · 1.79 KB
/
action.yml
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
name: Run DNF Integration Tests
inputs:
suite:
description: The suite to run (default is "dnf")
default: "dnf"
package-urls:
description: The URLs of RPM packages to test
required: true
extra-run-args:
description: Extra arguments for the container-test run command
default: ""
base-image:
description: The base image for the tests, defaults to the Dockerfile's default
default: ""
runs:
using: "composite"
steps:
- name: Run Integration Tests
shell: bash
run: |
# Nested container (podman) in container requires that the root
# cgroup is empty: https://github.com/containers/crun/issues/1226
# Move all running processes into a sub-cgroup.
mkdir /sys/fs/cgroup/init
pgrep '.*' |
while read pid; do
# pids can only be written one at a time
echo $pid > /sys/fs/cgroup/init/cgroup.procs;
done
# needed for podman user containers to work
export STORAGE_OPTS='overlay2.mount_program=/usr/bin/fuse-overlayfs'
echo "[engine]" > /etc/containers/containers.conf
echo "cgroup_manager = \"cgroupfs\"" >> /etc/containers/containers.conf
echo "events_logger = \"file\"" >> /etc/containers/containers.conf
BASE_ARG=""
if [ -n "${{inputs.base-image}}" ]; then
BASE_ARG="--base ${{inputs.base-image}}"
fi
echo "Downloading RPMs:"
for RPM in ${{inputs.package-urls}}; do
wget -P rpms ${RPM};
done
CONTAINER=$(uuidgen)
./container-test -c $CONTAINER build $BASE_ARG
TESTS=($(./container-test -c $CONTAINER -s "${{inputs.suite}}" list))
parallel -j2 ./container-test --container "$CONTAINER" -s "${{inputs.suite}}" run ${{inputs.extra-run-args}} "{}" ::: "${TESTS[@]}"