Skip to content

Quality checks & repository cleanup #97

Quality checks & repository cleanup

Quality checks & repository cleanup #97

# *******************************************************************************
# 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 Showcases RPMs
run: |
bazel build --config autosd-x86_64 //images/autosd_x86_64:score-reference-integration
working-directory: ./integration/images/autosd_x86_64
- name: Copy RPMs
run: |
set -e
mkdir -p ./images/autosd_x86_64/build/rpms
cp bazel-bin/images/autosd_x86_64/score-reference-integration-0.6.0-1.x86_64.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/CentOS/automotive/src/automotive-image-builder/-/raw/main/auto-image-builder.sh?ref_type=heads"
chmod +x auto-image-builder.sh
working-directory: ./integration/images/autosd_x86_64/build
- name: Build AutoSD QEMU (x86_64)
run: |
export AIB_LOCAL_CONTAINER_STORAGE=$PWD/_build/containers-storage
mkdir -p _build/containers-storage
sudo -E ./auto-image-builder.sh build-builder --distro=autosd10-sig
sudo -E ./auto-image-builder.sh build \
--distro=autosd10-sig \
--target=qemu \
--define-file vars.yml \
--define-file vars-devel.yml \
image.aib.yml \
localhost/score:latest
sudo -E ./auto-image-builder.sh to-disk-image localhost/score:latest _build/disk.qcow2
sudo chown $(id -u):$(id -u) _build/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'
working-directory: ./integration/images/autosd_x86_64/build
env:
SSH_PASSWORD: password
- name: Archive QEMU disk image (x86_64)
uses: actions/upload-artifact@v4
with:
name: autosd10-score-reference_integration-x86_64.qcow2
path: integration/images/autosd_x86_64/build/_build/disk.qcow2