From 2389221c4afab4ee73604b51c7af71b65e5507dd Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Tue, 5 Mar 2024 10:25:37 +0200 Subject: [PATCH] make kernel read/build and check part of CI Signed-off-by: Avi Deitcher --- .github/workflows/ci.yml | 17 +++++++++++++++++ .github/workflows/publish.yaml | 8 ++++++++ scripts/update-component-sha.sh | 4 ++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32f86a168..818f8ee7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9c4cd513a..3a97a5876 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -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 diff --git a/scripts/update-component-sha.sh b/scripts/update-component-sha.sh index 0ac21b351..c7da5970a 100755 --- a/scripts/update-component-sha.sh +++ b/scripts/update-component-sha.sh @@ -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