Skip to content

Images as single module #50

Images as single module

Images as single module #50

# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
name: AutoSD - Build & Test
on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'integration/**'
merge_group:
types: [checks_requested]
paths:
- 'integration/**'
jobs:
build:
name: x86_64
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.9.1
- name: Install System Dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y podman curl qemu-system createrepo-c
- name: Build Lola Demo
run: |
bazel build --config=autosd-x86_64 //images/autosd_x86_64:lola-demo
working-directory: ./integration
- name: Copy RPMs
run: |
set -e
mkdir -p ./images/autosd_x86_64/build/rpms
cp bazel-out/k8-fastbuild/bin/images/autosd_x86_64/lola-demo-1.0.0-1.x86_64.rpm ./images/autosd_x86_64/build/rpms
cp bazel-out/k8-fastbuild/bin/images/autosd_x86_64/lola-demo-1.0.0-1.src.rpm ./images/autosd_x86_64/build/rpms
createrepo_c ./images/autosd_x86_64/build/rpms/
ls -l ./images/autosd_x86_64/build/rpms/
working-directory: ./integration
- name: Install AIB Tools
run: |
curl -o auto-image-builder.sh "https://gitlab.com/lrossett/automotive-image-builder/-/raw/script-fix/auto-image-builder.sh?ref_type=heads"
chmod +x auto-image-builder.sh
curl -o automotive-image-runner "https://gitlab.com/CentOS/automotive/src/automotive-image-builder/-/raw/main/automotive-image-runner"
chmod +x automotive-image-runner
working-directory: ./integration/images/autosd_x86_64/build
- name: Build lola-demo.aib.yml
run: |
# sudo mkdir -p /host/rpms
# sudo mount --bind $(pwd)/rpms /host/rpms
ls -la rpms
sudo ./auto-image-builder.sh build-deprecated \
--distro autosd10 \
--mode package \
--target qemu \
--export qcow2 \
--define-file vars.yml \
--define-file vars-devel.yml \
image.aib.yml \
disk.qcow2
sudo chown $(id -u) disk.qcow2
working-directory: ./integration/images/autosd_x86_64/build
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Test QEMU image
run: |
sshcmd() {
sshpass -p "$SSH_PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2222 root@localhost $@
}
./scripts/run_qemu
sshcmd 'cat /etc/os-release'
sleep 10
sshcmd 'bluechictl start agent-qm lola-ipc-sub.service'
sleep 5
sshcmd '/usr/bin/lola-ipc-test'
working-directory: ./integration/images/autosd_x86_64/build
env:
SSH_PASSWORD: password
- name: Archive QEMU disk image
uses: actions/upload-artifact@v4
with:
name: autosd10-score-reference_integration-x86_64.qcow2
path: integration/images/autosd_x86_64/build/disk.qcow2