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 <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2022-01-11 19:30:30 +01:00
parent 0730c971b8
commit 3318a5c79c
3 changed files with 102 additions and 5 deletions

View File

@ -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

41
image-tests/isar/kas.yml Normal file
View File

@ -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:

36
image-tests/poky/kas.yml Normal file
View File

@ -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: