[github] enable blank_issues #309
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: kmod compatibility checks | |
on: | |
pull_request: | |
branches: | |
- develop | |
- main | |
push: | |
branches: | |
- develop | |
- main | |
jobs: | |
get_debuntu_releases: | |
runs-on: ubuntu-latest | |
steps: | |
- name: install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install curl jq | |
- name: calculate available releases | |
# the following does: | |
# - fetch all available tags for the "buildpack-deps" Docker image | |
# - fetch all available Ubuntu and Debian releases (that are still hosted on the distros' archive servers) | |
# - get the intersection of the tags and the releases | |
# - drop some releases (e.g. 'oldstable') | |
# - format as a JSON array | |
run: | | |
echo matrix=$(true; (curl -s "https://hub.docker.com/v2/repositories/library/buildpack-deps/tags?page_size=1000" | jq -r '.results[] | .name' | sort -u; for url in http://archive.ubuntu.com/ubuntu; do curl -s "${url}/dists/" | grep "href=" | sed -e 's|.*a href="||' -e 's|".*||' -e 's|/$||'; done | sort -u; for d in unstable testing stable oldstable; do echo $d; done) | sort | uniq -d | while read x; do echo -n '"'${x}'" '; done | sed -e 's|^ *|[|' -e 's| *$|]|' -e 's| *|,|g') | tee -a $GITHUB_OUTPUT | |
id: set-matrix | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
kmod-compile: | |
runs-on: ubuntu-latest | |
needs: get_debuntu_releases | |
strategy: | |
matrix: | |
series: ${{ fromJson(needs.get_debuntu_releases.outputs.matrix) }} | |
fail-fast: false | |
container: buildpack-deps:${{ matrix.series }} | |
env: | |
JOB_KNOWN_FAILURES: "3.13 3.16 3.19 4.2" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Compile against all available kernel header versions | |
shell: bash | |
run: | | |
apt-get update --quiet; | |
apt-get install --yes --no-install-recommends kmod | |
apt-get install --yes --no-install-recommends dkms || true | |
apt-cache search "linux-headers-[0-9.]*-[0-9]*-" | cut -d " " -f1 \ | |
| sed -e 's|linux-headers-\([0-9.]*\)-[0-9]*-\(.*\)|\0 \1 \2|' | sort -t- -k3,4 -V -r | sort -u -k2,3 -V | cut -d " " -f1 \ | |
| xargs apt-get install --yes --no-install-recommends | |
failed="" | |
succeeded="" | |
skipped="" | |
for kbuild in /lib/modules/*/build; do | |
test -d $kbuild || continue | |
kver=${kbuild%/build} | |
kver=${kver##*/} | |
echo "=== Testing ${kver} ==="; | |
ret=$(make KERNELRELEASE="${kver}" >&2; echo $?); | |
if [ ${ret} -eq 0 ]; then | |
succeeded="${succeeded} ${kver}" | |
modinfo v4l2loopback.ko; | |
else | |
case " ${JOB_KNOWN_FAILURES} " in | |
*" ${kver%.*} "*) | |
echo "#### Skipped known failure ${kver}"; | |
skipped="${skipped} ${kver}"; | |
;; | |
*) | |
if test -e "${kbuild}/.config" && ! grep -qE "^(CONFIG_VIDEO_DEV|CONFIG_VIDEO_V4L2)=" "${kbuild}/.config"; then | |
echo "#### Skipped failure ${kver} (no v4l2 support)"; | |
skipped="${skipped} ${kver}"; | |
else | |
echo "#### Unexpected failure ${kver}"; | |
failed="${failed} ${kver}"; | |
fi; | |
;; | |
esac; | |
fi; | |
make KERNELRELEASE="${kver}" clean || test ${ret} -ne 0 | |
done | |
if [ "x${failed}" != "x" ]; then | |
echo "#### Failed kernels: ${failed}"; | |
exit 1 | |
fi | |
if [ "x${skipped}" != "x" ]; then | |
echo "#### Skipped kernels: ${skipped}"; | |
fi | |
echo "#### Successful builds for kernels: ${succeeded}"; |