From 87f8bb050e52ab984816a36e643f28102e0fe1dd Mon Sep 17 00:00:00 2001 From: Wei Zhang Date: Fri, 17 Feb 2023 00:56:31 +0800 Subject: [PATCH] test: test build on docker and nerdctl Signed-off-by: Wei Zhang --- .github/workflows/test.yaml | 22 +++++++++++++++-- test/release/build.test.sh | 48 +++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5241414bb8..1353834632 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,6 +16,13 @@ concurrency: jobs: test-build: runs-on: ubuntu-latest + strategy: + matrix: + builder: + - docker + - nerdctl + env: + BUILDER: ${{ matrix.builder }} steps: - uses: actions/checkout@v3 - name: Set up Go @@ -33,15 +40,25 @@ jobs: run: | make build + - name: Install Nerdctl and Start Containerd + if: ${{ matrix.builder == 'nerdctl' }} + shell: bash + run: | + curl -sSL https://github.com/containerd/nerdctl/releases/download/v1.1.0/nerdctl-full-1.1.0-linux-amd64.tar.gz -o - | sudo tar -xz -C /usr/local + sudo systemctl daemon-reload + sudo systemctl enable --now containerd + containerd-rootless-setuptool.sh install + containerd-rootless-setuptool.sh install-buildkit-containerd + - name: Build Image shell: bash run: | - make build-image + BUILDER=${{ matrix.builder }} make build-image - name: Build Cluster Image shell: bash run: | - make build-cluster-image + BUILDER=${{ matrix.builder }} make build-cluster-image test-kwok: runs-on: ubuntu-latest @@ -170,6 +187,7 @@ jobs: sudo systemctl daemon-reload sudo systemctl enable --now containerd containerd-rootless-setuptool.sh install + containerd-rootless-setuptool.sh install-buildkit-containerd - name: Make pki directory if: ${{ matrix.kwokctl-runtime == 'binary' }} diff --git a/test/release/build.test.sh b/test/release/build.test.sh index 44662f7ff3..5a5507636c 100755 --- a/test/release/build.test.sh +++ b/test/release/build.test.sh @@ -73,36 +73,76 @@ docker buildx build --tag=kwok:${VERSION} --platform=linux/amd64 --load -f image EOF } +function want_image_nerdctl() { + cat <