make kernel read/build and check part of CI

Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
Avi Deitcher 2024-03-05 10:25:37 +02:00
parent 17f5ecaefd
commit 2389221c4a
3 changed files with 27 additions and 2 deletions

View File

@ -130,6 +130,23 @@ jobs:
run: |
make OPTIONS="-v --skip-platforms linux/s390x" -C test/pkg build
- name: Check Kernel Dependencies up to date
# checks that any kernel dependencies are up to date.
# if they are, then running `make update-kernel-yamls` will not change anything
run: |
echo "checking git diff before running make update-kernel-yamls"
git diff --exit-code
echo "running make update-kernel-yamls"
make -C kernel update-kernel-yamls
echo "checking git diff again after running make update-kernel-yamls; should be no changes"
git diff --exit-code
- name: Build Kernels
# ensures that the kernel packages are in linuxkit cache when we need them for tests later
# no need for excluding s390x, as each build.yml in the kernel explicitly lists archs
run: |
make OPTIONS="-v" -C kernel build
- name: list cache contents
run: |
linuxkit cache ls

View File

@ -63,3 +63,11 @@ jobs:
# Skip s390x as emulation is unreliable
run: |
make OPTIONS="--skip-platforms linux/s390x" -C pkg push PUSHOPTIONS="--nobuild"
- name: Publish Kernels
# this should only push changed ones:
# - unchanged: already in the registry
# - changed: already built and cached, so only will push
# No need to skip s390x, since kernel build.yml files all have explicit archs
run: |
make -C kernel push

View File

@ -69,7 +69,7 @@ case "${mode}" in
fi
old=$1
new=$2
git grep -E -l "\b($old)([[:space:]]|$)?" -- '*.yml' '*.yaml' '*.yml.in' '*.yaml.in' '*/Dockerfile' '*/Makefile' | grep -v /vendor/ | while read -r file; do sed -ri.bak -e "s,($old)([[:space:]]|$)?,$new\2,g" "$file"; done
git grep -E -l "\b($old)([[:space:]]|$)" -- '*.yml' '*.yaml' '*.yml.in' '*.yaml.in' '*/Dockerfile' '*/Makefile' | grep -v /vendor/ | while read -r file; do sed -ri.bak -e "s,($old)([[:space:]]|$),$new\2,g" "$file"; done
;;
--image)
if [ $# -lt 1 ] ; then
@ -99,4 +99,4 @@ case "${mode}" in
;;
esac
find . -name '*.bak' | xargs rm
find . -name '*.bak' | xargs rm || true