From 3318a5c79ca80bfad26b6057a6af318319233206 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 11 Jan 2022 19:30:30 +0100 Subject: [PATCH] ci: Add basic tests for built kas and kas-isar containers Break up the build into two stages, performing basic tests with poky and isar on the two kas container types before uploading them. The tests consist of building zlib-native with poky and cowsay for x86 bullseye with Isar. Note that the ordering "build kas", "test kas", "push kas", "build kas-isar" is important because "build kas-isar" will not use the locally built and imported kas:next image and rather pull the previous one from the registry. Signed-off-by: Jan Kiszka --- .github/workflows/next.yml | 30 +++++++++++++++++++++++----- image-tests/isar/kas.yml | 41 ++++++++++++++++++++++++++++++++++++++ image-tests/poky/kas.yml | 36 +++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 image-tests/isar/kas.yml create mode 100644 image-tests/poky/kas.yml diff --git a/.github/workflows/next.yml b/.github/workflows/next.yml index 9ad284a..b4cf9cd 100644 --- a/.github/workflows/next.yml +++ b/.github/workflows/next.yml @@ -61,8 +61,8 @@ jobs: scripts/checkcode.sh . TERM=xterm pytest - deploy_containers: - name: Build and deploy container images + build_containers: + name: Build, test and deploy container images needs: perform_tests runs-on: ubuntu-latest steps: @@ -81,14 +81,34 @@ jobs: - name: Build kas image uses: docker/build-push-action@v2 with: - platforms: linux/amd64,linux/arm64 - push: true + load: true tags: ghcr.io/siemens/kas/kas:next + - name: Test kas image + run: | + cd image-tests/poky + KAS_IMAGE_VERSION=next ../../kas-container build kas.yml + - name: Complete build and deploy kas image + uses: docker/build-push-action@v2 + with: + platforms: linux/amd64,linux/arm64 + tags: ghcr.io/siemens/kas/kas:next + push: true - name: Build kas-isar image + uses: docker/build-push-action@v2 + with: + file: Dockerfile.isar + load: true + build-args: KAS_TAG=next + tags: ghcr.io/siemens/kas/kas-isar:next + - name: Test kas-isar image + run: | + cd image-tests/isar + KAS_IMAGE_VERSION=next ../../kas-container build kas.yml + - name: Complete build and deploy kas-isar image uses: docker/build-push-action@v2 with: file: Dockerfile.isar platforms: linux/amd64,linux/arm64 build-args: KAS_TAG=next - push: true tags: ghcr.io/siemens/kas/kas-isar:next + push: true diff --git a/image-tests/isar/kas.yml b/image-tests/isar/kas.yml new file mode 100644 index 0000000..7eecc30 --- /dev/null +++ b/image-tests/isar/kas.yml @@ -0,0 +1,41 @@ +# +# kas - setup tool for bitbake based projects +# +# Copyright (c) Siemens AG, 2022 +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +header: + version: 11 + +build_system: isar + +machine: qemuamd64 +distro: debian-bullseye + +target: mc:qemuamd64-bullseye:cowsay + +repos: + isar: + url: https://github.com/ilbers/isar.git + refspec: 74036ebaab5265d62cdf90f563acd5b4d3b8b6d2 + layers: + meta: + meta-isar: diff --git a/image-tests/poky/kas.yml b/image-tests/poky/kas.yml new file mode 100644 index 0000000..8218d7e --- /dev/null +++ b/image-tests/poky/kas.yml @@ -0,0 +1,36 @@ +# +# kas - setup tool for bitbake based projects +# +# Copyright (c) Siemens AG, 2022 +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +header: + version: 11 + +target: zlib-native + +repos: + poky: + url: https://git.yoctoproject.org/poky.git + refspec: b53230c08d9f02ecaf35b4f0b70512abbf10ae11 + layers: + meta: + meta-poky: