From a115338ddd89bdafc611725d88adb01ba54578f1 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Tue, 9 Feb 2021 12:44:17 -0600 Subject: [PATCH 1/4] ci: snap: define proxy variables define proxy variables before using them to fix `unbound variable` error fixes #1386 Signed-off-by: Julio Montes --- snap/snapcraft.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 1286441c4..3ee86d820 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -89,6 +89,8 @@ parts: export GOROOT=${SNAPCRAFT_STAGE} export PATH="${GOROOT}/bin:${PATH}" + http_proxy=${http_proxy:-""} + https_proxy=${https_proxy:-""} if [ -n "$http_proxy" ]; then echo "Setting proxy $http_proxy" sudo -E systemctl set-environment http_proxy=$http_proxy || true From d0548414302460d1033fd0c2dae8ea80a6dfb35b Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Tue, 9 Feb 2021 13:18:44 -0600 Subject: [PATCH 2/4] ci: snap: build targets that not need sudo first `sudo` is required to build the image, once the image has been built the permission of some directories may change, let's build first the targerts that not need `sudo` Signed-off-by: Julio Montes --- snap/snapcraft.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 3ee86d820..6c1c3923c 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -69,7 +69,7 @@ parts: tar -xf ${tarfile} --strip-components=1 image: - after: [godeps] + after: [godeps, qemu, kernel] plugin: nil build-packages: - docker.io @@ -171,7 +171,7 @@ parts: fi kernel: - after: [godeps, image] + after: [godeps] plugin: nil build-packages: - libelf-dev @@ -208,7 +208,7 @@ parts: qemu: plugin: make - after: [godeps, runtime] + after: [godeps] build-packages: - gcc - python3 From 919d51274ddf3c2d9065449ee626ae02ee97caf4 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Fri, 12 Feb 2021 09:09:29 -0600 Subject: [PATCH 3/4] snap: fix kernel setup kernel setup fails when `yes "n"` is used and `make oldconfig` doesn't read anything from STDIN, `yes "n"` was added in the past as a workaround to fix incomplete kernel configs. Enable `build-kernel.sh` debug. Signed-off-by: Julio Montes --- snap/snapcraft.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 6c1c3923c..71f8cf221 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -185,8 +185,8 @@ parts: cd ${kata_dir}/tools/packaging/kernel - # Say 'no' to everithing, fix issues with incomplete .config files - yes "n" | ./build-kernel.sh setup + # Setup and build kernel + ./build-kernel.sh -d setup kernel_dir_prefix="kata-linux-" cd ${kernel_dir_prefix}* version=$(basename ${PWD} | sed 's|'"${kernel_dir_prefix}"'||' | cut -d- -f1) From ef72926bebfb55440566ed771da7e6fc221f003f Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Fri, 12 Feb 2021 09:18:45 -0600 Subject: [PATCH 4/4] ci: snap: run snap CI on every pull request Make sure a pull request doesn't break the snap packages, run snap CI on every pull request. Signed-off-by: Julio Montes --- .github/workflows/snap.yaml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/snap.yaml b/.github/workflows/snap.yaml index 8c7f946b9..40abbde98 100644 --- a/.github/workflows/snap.yaml +++ b/.github/workflows/snap.yaml @@ -1,15 +1,5 @@ name: snap CI -on: - pull_request: - paths: - - "**/Makefile" - - "**/*.go" - - "**/*.mk" - - "**/*.rs" - - "**/*.sh" - - "**/*.toml" - - "**/*.yaml" - - "**/*.yml" +on: ["pull_request"] jobs: test: runs-on: ubuntu-20.04