Debian Codegraph @

.github/workflows/tests.yml

raw
1 name: Run tests
2
3 on:
4 # Build at 23:00 every Sunday
5 schedule:
6 - cron: "0 23 * * 1"
7 pull_request:
8 push:
9
10 jobs:
11 test-distributions:
12 name: Build in containers
13 strategy:
14 matrix:
15 distro:
16 - {name: "almalinux", tag: "10"}
17 - {name: "almalinux", tag: "9"}
18 - {name: "almalinux", tag: "8"}
19 - {name: "alpine", tag: "3.22", variant: "-lts"}
20 - {name: "alpine", tag: "3.22", variant: "-virt"}
21 - {name: "alpine", tag: "3.21", variant: "-lts"}
22 - {name: "alpine", tag: "3.21", variant: "-virt"}
23 - {name: "alpine", tag: "3.20", variant: "-lts"}
24 - {name: "alpine", tag: "3.20", variant: "-virt"}
25 - {name: "alpine", tag: "3.19", variant: "-lts"}
26 - {name: "alpine", tag: "3.19", variant: "-virt"}
27 - {name: "archlinux", tag: "latest"}
28 - {name: "archlinux", tag: "latest", variant: "-lts"}
29 - {name: "archlinux", tag: "latest", variant: "-zen"}
30 - {name: "centos", tag: "stream10", url: "quay.io/centos/"}
31 - {name: "centos", tag: "stream9", url: "quay.io/centos/"}
32 - {name: "debian", tag: "13"}
33 - {name: "debian", tag: "12"}
34 - {name: "fedora", tag: "rawhide", url: "registry.fedoraproject.org/"}
35 - {name: "fedora", tag: "42", url: "registry.fedoraproject.org/"}
36 - {name: "fedora", tag: "41", url: "registry.fedoraproject.org/"}
37 - {name: "gentoo/stage3", tag: "latest"}
38 - {name: "opensuse/tumbleweed", tag: "latest", variant: "-default", url: "registry.opensuse.org/"}
39 - {name: "opensuse/leap", tag: "15.6", variant: "-default", url: "registry.opensuse.org/"}
40 - {name: "ubuntu", tag: "25.04"}
41 - {name: "ubuntu", tag: "24.04"}
42 - {name: "ubuntu", tag: "22.04"}
43 runs-on: ubuntu-24.04
44 container:
45 image: ${{ matrix.distro.url }}${{ matrix.distro.name }}:${{ matrix.distro.tag }}
46
47 steps:
48 - name: Install git for checkout action
49 if: contains(matrix.distro.name, 'opensuse')
50 run: |
51 zypper --non-interactive install git
52
53 - uses: actions/checkout@v5
54
55 - name: Install dependencies for Red Hat based distributions
56 if: matrix.distro.name == 'almalinux' || matrix.distro.name == 'centos' || matrix.distro.name == 'fedora'
57 # Relax crypto policies on Fedora 43+ to allow RSA signatures
58 run: |
59 dnf install -y gawk diffutils elfutils-libelf gcc kernel kernel-devel make openssl patch crypto-policies-scripts
60 update-crypto-policies --set LEGACY
61 make install-redhat
62
63 - name: Install Alpine dependencies
64 if: matrix.distro.name == 'alpine'
65 run: |
66 apk --no-cache --update add bash gcc linux-headers linux${{ matrix.distro.variant }} linux${{ matrix.distro.variant }}-dev make openssl coreutils patch
67 make install
68
69 - name: Install Arch Linux dependencies
70 if: matrix.distro.name == 'archlinux'
71 run: |
72 pacman -Syu --noconfirm diffutils gcc make linux${{ matrix.distro.variant }} linux${{ matrix.distro.variant }}-headers openssl patch
73 make install
74
75 - name: Install Debian dependencies
76 if: matrix.distro.name == 'debian'
77 run: |
78 export DEBIAN_FRONTEND=noninteractive
79 apt-get update -q
80 apt-get install -qy make linux-headers-amd64 linux-image-amd64 openssl xz-utils patch
81 make install-debian
82
83 - name: Install Gentoo Linux dependencies
84 if: matrix.distro.name == 'gentoo/stage3'
85 run: |
86 echo -e "MAKEOPTS=\"-j$(nproc) -l$(nproc)\"\nACCEPT_LICENSE=\"*\"" >> /etc/portage/make.conf
87 wget --progress=dot:mega -O - https://github.com/gentoo-mirror/gentoo/archive/master.tar.gz | tar -xz && mv gentoo-master /var/db/repos/gentoo
88 FEATURES="getbinpkg binpkg-ignore-signature parallel-fetch parallel-install pkgdir-index-trusted" USE="-initramfs" emerge --quiet --noreplace -j$(nproc) -l$(nproc) --autounmask-continue --with-bdeps=n '>=sys-kernel/gentoo-kernel-bin-6.6.0'
89 make install
90
91 - name: Install openSUSE leap dependencies
92 if: contains(matrix.distro.name, 'opensuse')
93 run: |
94 zypper --non-interactive install diffutils elfutils gcc kernel${{ matrix.distro.variant }} kernel${{ matrix.distro.variant }}-devel make openssl patch zstd
95 make install
96
97 - name: Install Ubuntu dependencies
98 if: matrix.distro.name == 'ubuntu'
99 run: |
100 export DEBIAN_FRONTEND=noninteractive
101 apt-get update -q
102 apt-get install -qy gcc make linux-headers-generic linux-image-generic openssl shim-signed patch
103 make install-debian
104
105 - name: Run tests
106 run: |
107 for moddir in /usr/lib/modules/ /lib/modules/; do
108 if [ -e "$moddir" ]; then
109 kernels=$(find "$moddir" -maxdepth 1 -type d -exec basename {} \;)
110 break
111 fi
112 done
113
114 # There should be two entries - "modules" and the kernel we installed
115 if [ $(echo "${kernels}" | wc -l) -ne 2 ]; then
116 echo >&2 "Error: invalid number of kernels installed"
117 fi
118
119 KERNEL_VER=$(echo "${kernels}" | tail -n1)
120 if [ -z "${KERNEL_VER}" ] ; then
121 echo >&2 "Error: no kernel package found"
122 exit 1
123 fi
124
125 echo "Found kernel ${KERNEL_VER}"
126 export KERNEL_VER
127
128 echo "Module search paths"
129 for depmod in /etc/depmod.d/ /usr/lib/depmod.d/ /lib/depmod.d/; do
130 [ -e "$depmod" ] && grep -r ^search "$depmod" || true
131 done
132
133 # Run all tests
134 ./run_test.sh