From e7e16a420a482cdf4f875ead7916f09061ed4dde Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Mon, 9 Jun 2025 20:42:01 +0800 Subject: [PATCH] ci: add bootc RPM build and bootc container image build Will run for each PR to build RPM and re-build bootc container to replace bootc with new build one Signed-off-by: Xiaofeng Wang --- .github/workflows/e2e.yml | 101 ++++++++++++++++++++++++++++++++++ .packit.yaml | 8 ++- contrib/scripts/mock_build.sh | 30 ++++++++++ 3 files changed, 136 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/e2e.yml create mode 100755 contrib/scripts/mock_build.sh diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 00000000..ea801287 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,101 @@ +name: build bootc and bootc image + +on: + pull_request: + branches: [ main ] + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, ubuntu-24.04-arm] + # os: [ubuntu-latest] + # distro: [fedora-41, fedora-42, fedora-r43, centos-stream-9, centos-stream-10] + distro: [centos-stream-9] + runs-on: ${{ matrix.os }} + + # Required to push container image to ghcr.io + # https://github.com/orgs/community/discussions/57724 + permissions: + contents: read + packages: write + attestations: write + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Build bootc RPM + env: + DISTRO: ${{ matrix.distro }} + BUILD_IMAGE: quay.io/fedora/fedora:42 + run: | + podman run \ + --rm \ + --privileged \ + -v $(pwd):/workdir:z \ + -e DISTRO=$DISTRO \ + --workdir /workdir \ + $BUILD_IMAGE \ + contrib/scripts/mock_build.sh + + - name: Re-build bootc image with new bootc PRM + env: + DISTRO: ${{ matrix.distro }} + run: | + set -xeu + if [[ $DISTRO =~ fedora ]]; then + VERSION_ID=$(cut -d'-' -f2 <<<"$DISTRO") + BASE_IMAGE="quay.io/fedora/fedora-bootc:${VERSION_ID}" + fi + if [[ $DISTRO =~ centos ]]; then + VERSION_ID=$(cut -d'-' -f3 <<<"$DISTRO") + BASE_IMAGE="quay.io/centos-bootc/centos-bootc:stream${VERSION_ID}" + fi + + tee target/build/Containerfile >/dev/null <